[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Slight problem with recent change?
From: |
Paul Hilfinger |
Subject: |
Slight problem with recent change? |
Date: |
Tue, 07 Jun 2005 19:28:10 -0700 |
Paul,
According to the ChangeLog, on 5/27/2005, you checked in a change to
data/yacc.c that included:
(malloc, free): Declare, but only if needed, as this infringes on
the user name space.
Specifically,
# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
&& (defined (__STDC__) || defined (__cplusplus)))
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
and
# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
&& (defined (__STDC__) || defined (__cplusplus)))
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
If defined (__cplusplus), shouldn't those declarations be enclosed in
extern "C" {
...
}
?
If they aren't, then there are annoying order-dependencies. If the
user includes <cstdlib> in the first set of user declarations, there
is no problem. But if he doesn't, and instead puts #include <cstdlib>
in the second set of user declarations, one gets an error (at least in
g++ 3.3.2).
Paul Hilfinger
- Slight problem with recent change?,
Paul Hilfinger <=