473,320 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

missing #endif problem

Hi All,

I have large file coded consisting of function implemented in c.
This function consissts of #if macro and corresponding. And somewhere
in the function i am missing to put #endif , Is there any utility to find it
out
I get syntax error

for example

#define XXX 1
void f()
{
#if XXX

}

int main()
{
f();
return 0;
}

I get here syntax error in the function f();

Is there any way to find out instead of doing manually

TIA
Mohan
Jan 16 '06 #1
1 3477
mohan wrote:
Hi All,

I have large file coded consisting of function implemented in c.
You'll probably want to re-factor this large function into several
shorter ones. Having large functions is generally (always?) a bad idea.
This function consissts of #if macro and corresponding.
"And corresponding" what? I guess #endif? But it doesn't...
And somewhere
in the function i am missing to put #endif , Is there any utility to find it
out
If it's missing, you can't find it out, can you? If you meant "find out
where it should have been" then, doesn't it depend on what exactly you
want to achieve with your #if/#endif section? There'd be no utility to
tell you that (high level/detailed design document could be a starting
point).
I get syntax error

for example

#define XXX 1
void f()
{
#if XXX

For example, here would be a good place to put your #endif, if you
wanted your function to be empty (do nothing) if XXX is defined as 0.
Just before the closing brace:

#endif /* XXX */ }

int main()
{
f();
return 0;
}

I get here syntax error in the function f();
As you well should, since you're missing an #endif...

Is there any way to find out instead of doing manually
Again, find out what, exactly? Where to put the #endif? See comments above.

TIA
Mohan


Cheers

Vladimir

--
My e-mail address is real, and I read it.
Jan 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alex Sedow | last post by:
// Microsoft Visual Studio .NET\vc7\PlatformSDK\include\Comdef.h(266) - missing ')' // Microsoft Visual Studio .NET 2003\vc7\PlatformSDK\include\Comdef.h(266) - missing ')' #if...
5
by: Annette Massie | last post by:
I have a park permit tracking database where I was thinking of having the user enter all the park permits individually, however realized that in a day, a park could host many daily users. So if 100...
0
by: BetaTesterWannabe | last post by:
I have an unmanaged win32 dll, fileparser.dll I have a managed c++ dll, fileparser_mcpp.dll, that references fileparser.dll. I then reference fileparser_mcpp.dll from some c# code. in...
0
by: Egghead | last post by:
Hi all, I'm hoping someone can help me see through what seems like it should be a simple problem. I am trying to print the contents of a table and have noticed that the last page is missing. Any...
1
by: BobPaul | last post by:
I'm following code out of a howto book and this is really bugging me. This header file was created by VStudio 6.0 when I did a "Right Click: Add Member Function" CLine is a class I wrote (per the...
2
by: not_a_commie | last post by:
Are there any tools available to track down IDisposable objects that don't have a call to Dispose? I'm thinking this can be done with static code analysis. If the object is created inside a method,...
2
by: msaurea | last post by:
Hi, I have getting the error about this. Hope you could help SELECT .UPC_ID, DB2SH000_LU_NUTRIENT_FACTOR.UPC_ID, DB2SH000_LU_NUTRIENT_FACTOR.NDB_NBR, .Source FROM LEFT JOIN...
6
by: zmee | last post by:
Hi, I'm doing a little game in OpenGL for college and I've got these 3 classes in C++: WarBalls - represents the Game's Application. It is supposed to be a singleton and holds all the Game's...
1
by: yookoala | last post by:
Hello, I'm compiling something with GCC 4.4.1 Here I got some error from make. It says: This is the content of line 233 to 291:
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.