Need some help with pre-processign functions in C using Doxygen ...

Apr 11, 2005 3 Replies

Hi,



I'm currently documenting source code in C and would like to skip some functions that don't need to be documented.



The syntax that I'm using is defined below.



#ifndef SKIP



/* Code to be skipped */



#endif SKIP



Where SKIP= Predifined Tag Name



I'd like to know if anyone on this list has been using Doxygen to pre-process code fragments.



In case you do pre-process the code, I'd appreciate your inputs with an alternative method to ignore code fragments.



The problem is that Doxygen compiles it but the C compiler reads the /* Code to be skipped */ as comments !!!



Please help ! Thanks, Ruchi



Of course it does! You wrote it as a /* comment */, after all, so what else would the C compiler be expect to think it is? Now, here's the question your post failed to address: why is that "the problem"?

Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.

I think what he meant was that within the section of code between the #ifndef and the #endif, the C compiler jumped over the code (since it is removed by the pre-processor), while Doxygen used the code. Thus Doxygen is generating documentation for functions that are never seen by the compiler. Don't know the answer to the problem, however, having only used doxygen a few times.

It works for me. Make sure that - "ENABLE_PREPROCESSING = YES" is included in your doxygen config file. - SKIP is defined, e.g. by having "PREDEFINED = SKIP" in your doxygen config file or by defining it by "#define SKIP" in the source. (The former is definitively nicer.)

Best regards, Tobias

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required