Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > missing #endif problem

Reply
Thread Tools

missing #endif problem

 
 
mohan
Guest
Posts: n/a
 
      01-16-2006
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


 
Reply With Quote
 
 
 
 
Vladimir S. Oka
Guest
Posts: n/a
 
      01-16-2006
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Reports - Visual Basic UFL that implements this function is missing (or U2lcom.dll is missing) Les Caudle ASP .Net 3 09-03-2007 02:27 AM
Re: missing feature classes and missing fields Gary Herron Python 2 07-04-2006 10:29 PM
visual studio 2003 problem Design View all object missing =?Utf-8?B?cnQ=?= ASP .Net 1 05-26-2005 12:01 PM
Knowledge base is MISSING THE FIX for validators problem Sean ASP .Net 4 03-02-2004 06:23 AM
Problem with missing button clicks John Smith Jr. ASP .Net 5 12-14-2003 07:02 AM



Advertisments