Re: How to use C89 with certain C99 features

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

 



If your code is better because it uses some
C99 features, then use those features and write code that is better
for
98% of your potential users. Your code then conforms to C99
standards,
but /may/ work on some non-C99 compilers.

That's what I'm thinking. I can't figure out how to provide the functionality I need using C89. The functionality I need is:

1.  Variadic macros, which allows me to do this:

#define myprintfwrapper (A,...) myfunc (__FILE__,__LINE__,A,__VA_ARGS__)
void myfunc (char *szfile, int line, A, ...);

2. Struct initialization with run-time data, which allows const members of the struct to contain run-time data. I make the members const for efficiency and error prevention.

If anyone can figure out how to do those things with C89, let me know.

Richard




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux