Re: [Doxygen-users] Problems w/ typedef + struct + __attribute__((packed)) macro
Brought to you by:
dimitri
From: Albert <alb...@gm...> - 2011-01-30 14:37:24
|
Hi Dave, Had a look at your problem, but cannot get directly perfect results either. It looks to me that the comment of the packed typedef is stripped in a bit of a strange way. Running only the preprocessor for Doxygen results in: C:\Users\user\AppData\Local\Temp\Dave>doxygen -d Preprocessor compressed_doxygen _cfg.txt #define PACKED(x) 00002 00003 /** \brief a packed test structure */ 00004 typedef 00005 /** this is a */ 00006 00007 /** this is b */ 00008 00009 struct { int a; int b;} packed_type_t; 00010 00011 /** \brief an unpacked test structure */ 00012 typedef struct { 00013 /** this is a */ 00014 int a; 00015 /** this is b */ 00016 int b; 00017 } unpacked_type_t; 00018 00019 Here we see that the comment is outside the struct definition and has no real reference to a and b anymore also \var does not really help. Took me quite a bit of tweaking but when I nearly had finished this email (with some sub optimal results) I got a small brain wave. First I tried to put the documentation between the typedef and the struct words (separate lines etc.) but this didn't give nice results either. My last test see the attached broken.c gave the best results I think (line numbers are a bit off, but this is again due to the preprocessing step.. Looks like the comment in combination with the define is not working as it should in the internal preprocessor. You could file a bug report for it (or even better try to fix the problem :-) ) Best Regards, Albert On Thu, Jan 13, 2011 at 22:27, Dave Barach <dxy...@ba...> wrote: > The following C source snippet seems to behave badly w/ doxygen 1.7.3, as > well as earlier versions: > > > > #define PACKED(x) x __attribute__ ((packed)) > > > > /** \brief a packed test structure */ > > typedef PACKED(struct { > > /** this is a */ > > int a; > > /** this is b */ > > int b; > > }) packed_type_t; > > > > /** \brief an unpacked test structure */ > > typedef struct { > > /** this is a */ > > int a; > > /** this is b */ > > int b; > > } unpacked_type_t; > > > > I've tried a couple of different preprocessor setups -- see below -- but I > can't find one that yields good results. Unfortunately one of my colleagues > this particular construct quite regularly. > > > > Suggestions welcome... Thanks, Dave Barach > > > > #--------------------------------------------------------------------------- > > # Configuration options related to the preprocessor > > #--------------------------------------------------------------------------- > > ENABLE_PREPROCESSING = YES > > MACRO_EXPANSION = YES > > EXPAND_ONLY_PREDEF = YES > > SEARCH_INCLUDES = YES > > INCLUDE_PATH = > > INCLUDE_FILE_PATTERNS = > > PREDEFINED = PACKED(x)=x > > EXPAND_AS_DEFINED = > > SKIP_FUNCTION_MACROS = YES > > > > and: > > > > #--------------------------------------------------------------------------- > > # Configuration options related to the preprocessor > > #--------------------------------------------------------------------------- > > ENABLE_PREPROCESSING = YES > > MACRO_EXPANSION = NO > > EXPAND_ONLY_PREDEF = NO > > SEARCH_INCLUDES = YES > > INCLUDE_PATH = > > INCLUDE_FILE_PATTERNS = > > PREDEFINED = > > EXPAND_AS_DEFINED = > > SKIP_FUNCTION_MACROS = YES > > > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Doxygen-users mailing list > Dox...@li... > https://lists.sourceforge.net/lists/listinfo/doxygen-users > > |