2 # -----------------------------------------------------------------------------
4 my $cc = $ENV{'REAL_CC'} || 'cc';
5 my $check = $ENV{'CHECK'} || 'check';
9 # Look for a .c file. We don't want to run the checker on .o or .so files
10 # in the link run. (This simplistic check knows nothing about options
11 # with arguments, but it seems to do the job.)
12 $seen_a_c_file = 1 if /^[^-].*\.c/;
14 my $this_arg = ' ' . "e_arg
($_);
15 $cc .= $this_arg unless &check_only_option
($_);
19 system ($check) if $seen_a_c_file;
22 # -----------------------------------------------------------------------------
23 # Check if an option is for "check" only.
25 sub check_only_option
{
27 return 1 if $arg =~ /^-W(no-?)?default-bitfield-sign$/;
31 # -----------------------------------------------------------------------------
32 # Simple arg-quoting function. Just adds backslashes when needed.
36 return "''" if $arg eq '';
39 m
|^[-a
-zA
-Z0
-9._
/,=]+$| ?
$_ : "\\" . $_;
40 } (split (//, $arg)));
43 # -----------------------------------------------------------------------------