/* Check system header files for ISO 9899:1990 (ISO C) compliance.
- Copyright (C) 1996,97,98,99,2001,02 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jens Schweikhardt <schweikh@noc.dfn.de>, 1996.
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
/* This is a simple minded program that tries to find illegal macro
definitions in system header files. Illegal macro definitions are
# define _GNU_SOURCE 1
#endif
+#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Format string to build command to invoke compiler. */
static const char fmt[] = "\
echo \"#include <%s>\" |\
-%s -E -dM -ansi -pedantic %s -D_LIBC -D_ISOMAC -DNOT_IN_libc -I. \
+%s -E -dM -ansi -pedantic %s -D_LIBC -D_ISOMAC \
+-DIN_MODULE=MODULE_extramodules -I. \
-isystem `%s --print-prog-name=include` - 2> /dev/null > %s";
if (system (command))
{
puts ("system() returned nonzero");
+ free (command);
return NULL;
}
free (command);
start = &line[8];
for (end = start + 1; !isspace (*end) && *end != '\0'; ++end)
;
- result[result_len++] = xstrndup (start, end - start);
+ result[result_len] = xstrndup (start, end - start);
- if (first)
+ if (strcmp (result[result_len], "IN_MODULE") != 0)
{
- fputs ("The following identifiers will be ignored since the compiler defines them\nby default:\n", stdout);
- first = 0;
+ if (first)
+ {
+ fputs ("The following identifiers will be ignored since the compiler defines them\nby default:\n", stdout);
+ first = 0;
+ }
+ puts (result[result_len]);
}
- puts (result[result_len - 1]);
+ ++result_len;
}
if (result_len == result_max)
{