autoconf
[Top][All Lists]
Advanced

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

double underscores in autoconf-defined symbol names


From: Vadim Zeitlin
Subject: double underscores in autoconf-defined symbol names
Date: Mon, 9 Jan 2006 14:27:38 +0100

 Hello,

 I'd like to know if there is any standard way of dealing with a problem
which arises when you use AC_CHECK_FUNCS with a function whose name begins
with an underscore (e.g. _snprintf) and then use the result of the test in
C++ code. To be precise, the problem is that AC_CHECK_FUNCS would define a
symbol HAVE__SNPRINTF which, according to 17.4.3.1.2 of the ISO C++
standard, is a reserved symbol in C++ program and so can't be used.

 Of course, it's pretty simple to work around this problem by using
AC_CHECK_FUNC instead but as I'm surely not the first one to be in such
situation, I'd like to know:

1. What do the others do? Just ignore this problem (hoping that HAVE__XXX
   is not really reserved) or is there something better?
2. Is there any more or less standard convention for naming HAVE symbol for
   such functions (HAVE_UNDERSCORE_SNPRINTF looks a bit ugly)?
3. Is it worth looking into patching autoconf to change AC_CHECK_FUNCS to
   not generate reserved symbols for such functions or if such patch would
   not be accepted anyhow (e.g. because of backwards compatibility)?

 Thanks in advance,
VZ





reply via email to

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