6 messages in com.mysql.lists.plusplusToken pasting warning spam on GCC 3.x
FromSent OnAttachments
Warren Young07 Mar 2003 13:53 
Jonathan Arnold07 Mar 2003 14:15 
Warren Young11 Mar 2003 21:26 
Jonathan Arnold12 Mar 2003 07:07 
Warren Young12 Mar 2003 11:35 
Warren Young12 Mar 2003 11:59.patch
Subject:Token pasting warning spam on GCC 3.x
From:Warren Young (war@etr-usa.com)
Date:03/07/2003 01:53:05 PM
List:com.mysql.lists.plusplus

Recent versions of g++ correctly warn when you use the token-pasting operator (##) to paste together two things that are not a valid token. The compiler's correct to warn about this, since the operator is only needed for creating tokens. In all other cases, you can either remove the ## or replace it with whitespace.

As a test, I went through the one macro I use in custom-macros.hh and removed all the incorrect ##'s. Originally, my simple program that used this macro was making the compiler spew nearly 300 warnings; after cleaning up that one macro, I got it down to 15 warnings. I don't know where the remaining problem spots are, but if all the pointless ##'s were taken out of custom-macros.hh, I imagine the last of my warnings would go away, too.

This isn't a cosmetic problem. I use vim to build my programs, and it's configured to jump to the line number of errors and warnings after a make, so it's always taking focus away from where I was working to point out old warnings after every build. Since there's no way to turn off just this one warning, I have to turn off all warnings (-w) to avoid this focus loss. That's not a very good solution.

If people are the maintainers are too busy to fix this, I'll send a patch. Is changing custom-macros.hh the right place to do this, or is it a generated file?