bug-gnulib
[Top][All Lists]
Advanced

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

Re: Module with preprocessor utilities


From: Paul Eggert
Subject: Re: Module with preprocessor utilities
Date: Mon, 20 Jul 2020 11:14:21 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

I'm a bit leery of this idea, as it is painful to write and debug reliable preprocessor macros. When you need macros you really need them, but they're best avoided in the first place.

The fanciest macros I've contributed to Gnulib are in <intprops.h>; they had to be macros because C won't let you write polymorphic functions. A quick look at the P99 package suggests it wouldn't have helped me write or debug the intprops.h macros, and that it's intended more for meta-macro programming, something that gets pretty hairy pretty quickly and something I'm not sure I'd like to encourage. (Reading the warning for P99_IS_EMPTY gives me the willies, for example.)

That being said, if there's a need for a particular macro for something Gnulibish then of course we should be all ears.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]