Re: Use of C++ Keyword as variable name



On 29 Mar 2001, Dan Winship wrote:

> > If any volunteers are feeling bored, it might be nice to have
> > configure.in for glib/pango/gtk check for the c++ compiler, do an
> > AM_CONDITIONAL on it, and iff the compiler is found build a test
> > program in the tests subdir that is just an empty main() but includes
> > all the library headers. Then these keyword uses will break
> > compilation and get discovered right away.
> 
> You don't really need c++. Just "#define class $" or something.
> 
> You could even add that to glib.h (with an #ifndef __cplusplus around
> it). :-)

Except that it is valid to use that word in C code (such as GTK+).  Only
the headers need to be c++ keyword free.  Breaking valid C++ code would
not be a good idea (which putting that in glib.h would do).

James.

-- 
Email: james daa com au
WWW:   http://www.daa.com.au/~james/






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]