mirror of
git://git.sv.gnu.org/autoconf
synced 2025-02-17 14:01:27 +08:00
* bin/autoscan.in (%c_keywords): Build it at top level.
Map to 1 in order to simplify its uses.
This commit is contained in:
parent
32e1426355
commit
4f944b43d5
@ -1,3 +1,9 @@
|
|||||||
|
2001-11-26 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* bin/autoscan.in (%c_keywords): Build it at top level.
|
||||||
|
Map to 1 in order to simplify its uses.
|
||||||
|
|
||||||
|
|
||||||
2001-11-26 Akim Demaille <akim@epita.fr>
|
2001-11-26 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* bin/autoscan.in (&scan_c_file, &scan_sh_file, &scan_makefile):
|
* bin/autoscan.in (&scan_c_file, &scan_sh_file, &scan_makefile):
|
||||||
|
@ -35,7 +35,13 @@ use File::Basename;
|
|||||||
use File::Find;
|
use File::Find;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
use vars qw(@cfiles @makefiles @shfiles %c_keywords %printed);
|
use vars qw(@cfiles @makefiles @shfiles %printed);
|
||||||
|
|
||||||
|
# The list of C keywords.
|
||||||
|
my %c_keywords = map { $_ => 1}
|
||||||
|
qw (int char float double struct union long short unsigned
|
||||||
|
auto extern register typedef static goto return sizeof break
|
||||||
|
continue if else for do while switch case default);
|
||||||
|
|
||||||
# $USED{KIND}{ITEM} is set if ITEM is used in the program.
|
# $USED{KIND}{ITEM} is set if ITEM is used in the program.
|
||||||
# It is set to its list of locations.
|
# It is set to its list of locations.
|
||||||
@ -138,13 +144,6 @@ sub init_tables ()
|
|||||||
# ANSI C, GNU C, and C++ keywords can introduce portability problems,
|
# ANSI C, GNU C, and C++ keywords can introduce portability problems,
|
||||||
# so don't ignore them.
|
# so don't ignore them.
|
||||||
|
|
||||||
foreach (qw (int char float double struct union long short unsigned
|
|
||||||
auto extern register typedef static goto return sizeof break
|
|
||||||
continue if else for do while switch case default))
|
|
||||||
{
|
|
||||||
$c_keywords{$_} = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
# The data file format supports only one line of macros per function.
|
# The data file format supports only one line of macros per function.
|
||||||
# If more than that is required for a common portability problem,
|
# If more than that is required for a common portability problem,
|
||||||
# a new Autoconf macro should probably be written for that case,
|
# a new Autoconf macro should probably be written for that case,
|
||||||
@ -260,12 +259,12 @@ sub scan_c_file ($)
|
|||||||
while (s/\b([a-zA-Z_]\w*)\s*\(/ /)
|
while (s/\b([a-zA-Z_]\w*)\s*\(/ /)
|
||||||
{
|
{
|
||||||
used ('functions', $1)
|
used ('functions', $1)
|
||||||
if !defined $c_keywords{$1};
|
if !$c_keywords{$1};
|
||||||
}
|
}
|
||||||
while (s/\b([a-zA-Z_]\w*)\b/ /)
|
while (s/\b([a-zA-Z_]\w*)\b/ /)
|
||||||
{
|
{
|
||||||
used ('identifiers', $1)
|
used ('identifiers', $1)
|
||||||
if !defined $c_keywords{$1};
|
if !$c_keywords{$1};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user