I'll look at it. I did not want to include it in the C files as it makes them messy with #ifdef UNIX and so on.
Jim > -----Original Message----- > From: [email protected] [mailto:antlr-interest- > [email protected]] On Behalf Of Christopher L Conway > Sent: Thursday, March 04, 2010 10:43 AM > To: [email protected] > Subject: [antlr-interest] Macro redefinition warnings from libantlr3c > headers > > I'm getting a lot of compiler warnings like the following when I > compile against libantlr3c: > > In file included from > /home/chris/Tools/builds/libantlr3c/include/antlr3defs.h:217, > from > /home/chris/Tools/builds/libantlr3c/include/antlr3.h:33, > ... > /home/chris/Tools/builds/libantlr3c/include/antlr3config.h:92:1: > warning: "PACKAGE" redefined > > and so on for PACKAGE_BUGREPORT, PACKAGE_NAME, etc. > > Apparently, this is due to Automake-generated symbols being exported > in the public header files (we use Automake too, so we have the same > symbols in our project). There's some information about errors like > these in this StackOverflow question: > http://stackoverflow.com/questions/7398/how-to-avoid-redefining- > version-package-etc > > I'm not sure what the best fix for this is. There are at least two > options: > > 1. Rename antlr3config.h to config.h. I believe this will cause the > #include in antlr3defs.h to pick up my project's config.h, which may > or may not be a problem. I can confirm that this change makes the > compiler warnings disappear. > > 2. Make sure antlr3config.h in only #include'd from .c files, maybe by > breaking antlr3defs.h into a public and private portion. > > This is a minor thing, but it's apt to make my colleagues grouchy > about adopting ANTLR3 (they like a clean build ;-)... > > Regards, > Chris > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your- > email-address List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
