* tests/regression.at (Invalid CPP headers): New.

From Alexander Belopolsky.
* src/files.c (compute_header_macro): Map non alnum chars to `_'.
This commit is contained in:
Akim Demaille
2001-10-02 16:17:41 +00:00
parent f1394282f0
commit d9302e4b73
4 changed files with 51 additions and 25 deletions

View File

@@ -1,3 +1,9 @@
2001-10-02 Akim Demaille <akim@epita.fr>
* tests/regression.at (Invalid CPP headers): New.
From Alexander Belopolsky.
* src/files.c (compute_header_macro): Map non alnum chars to `_'.
2001-10-02 Akim Demaille <akim@epita.fr> 2001-10-02 Akim Demaille <akim@epita.fr>
* tests/regression.at (Invalid input): New. * tests/regression.at (Invalid input): New.

31
THANKS
View File

@@ -1,24 +1,25 @@
Bison was originally written by Robert Corbett. It would not be what Bison was originally written by Robert Corbett. It would not be what
it is today without the invaluable help of these people: it is today without the invaluable help of these people:
Akim Demaille akim@epita.fr Akim Demaille akim@epita.fr
Albert Chin-A-Young china@thewrittenword.com Albert Chin-A-Young china@thewrittenword.com
Daniel Hagerty hag@gnu.org Alexander Belopolsky alexb@rentec.com
David J. MacKenzie djm@gnu.org Daniel Hagerty hag@gnu.org
Fabrice Bauzac noon@cote-dazur.com David J. MacKenzie djm@gnu.org
Hans Aberg haberg@matematik.su.se Fabrice Bauzac noon@cote-dazur.com
Jesse Thilo jthilo@gnu.org Hans Aberg haberg@matematik.su.se
Jim Meyering meyering@gnu.org Jesse Thilo jthilo@gnu.org
Juan Manuel Guerrero ST001906@HRZ1.HRZ.TU-Darmstadt.De Jim Meyering meyering@gnu.org
Keith Browne kbrowne@legato.com Juan Manuel Guerrero ST001906@HRZ1.HRZ.TU-Darmstadt.De
Laurent Mascherpa laurent.mascherpa@epita.fr Keith Browne kbrowne@legato.com
Laurent Mascherpa laurent.mascherpa@epita.fr
Marc Autret autret_m@epita.fr Marc Autret autret_m@epita.fr
Neil Booth NeilB@earthling.net Neil Booth NeilB@earthling.net
Noah Friedman friedman@gnu.org Noah Friedman friedman@gnu.org
Pascal Bart pascal.bart@epita.fr Pascal Bart pascal.bart@epita.fr
Paul Eggert eggert@twinsun.com Paul Eggert eggert@twinsun.com
Piotr Gackiewicz gacek@intertel.com.pl Piotr Gackiewicz gacek@intertel.com.pl
Richard Stallman rms@gnu.org Richard Stallman rms@gnu.org
Robert Anisko anisko_r@epita.fr Robert Anisko anisko_r@epita.fr
Shura debil_urod@ngs.ru Shura debil_urod@ngs.ru

View File

@@ -94,8 +94,7 @@ stringappend (const char *string1, const char *string2)
static char * static char *
compute_header_macro (void) compute_header_macro (void)
{ {
int ite; char *macro_name, *cp;
char *macro_name;
if (spec_defines_file) if (spec_defines_file)
macro_name = xstrdup (spec_defines_file); macro_name = xstrdup (spec_defines_file);
@@ -109,14 +108,12 @@ compute_header_macro (void)
strcat (macro_name, header_extension); strcat (macro_name, header_extension);
} }
for (ite = 0; macro_name[ite]; ite++) for (cp = macro_name; *cp; ++cp)
if (macro_name[ite] == '.') if (islower (*cp))
macro_name[ite] = '_'; *cp = toupper (*cp);
else else if (!isalnum (*cp))
{ *cp = '_';
if (islower (macro_name[ite]))
macro_name[ite] -= ('a' - 'A');
}
return macro_name; return macro_name;
} }

View File

@@ -107,3 +107,25 @@ input.y:3: fatal error: no rules in the input grammar
]) ])
AT_CLEANUP AT_CLEANUP
## --------------------- ##
## Invalid CPP headers. ##
## --------------------- ##
AT_SETUP([Invalid CPP headers])
mkdir input
AT_DATA([input/input.y],
[%%
dummy:
])
AT_CHECK([bison --defines input/input.y])
AT_CHECK([sed 1q input/input.tab.h], 0,
[[#ifndef INPUT_INPUT_TAB_H
]])
AT_CLEANUP(input)