diff options
author | Eric Blake <eblake@redhat.com> | 2010-03-19 10:34:25 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2010-03-20 07:26:18 -0600 |
commit | 07505db6b97bc6e8a50210ad5bf483894fc75c16 (patch) | |
tree | 84d03b45d5a59910258044121c76a0bbc8a71ccb /src | |
parent | 159c02545be1bd4342d27c7ea5b9d06459d3c8aa (diff) | |
download | grep-07505db6b97bc6e8a50210ad5bf483894fc75c16.tar.gz |
build: allow compilation on cygwin
Gnulib is incompatible with -Wunused-macros. Addtionally,
cygwin 1.7.1 coupled with --enable-gcc-warnings tripped on:
grep.c: In function 'print_line_middle':
grep.c:805: error: array subscript has type 'char' [-Wchar-subscripts]
grep.c: In function 'main':
grep.c:1833: error: 'optarg' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
grep.c:1834: error: 'optind' redeclared without dllimport attribute after being referenced with dll linkage
* configure.ac (GNULIB_WARN_FLAGS): Disable -Wunused-macros.
* src/grep.c (print_line_middle): Use correct type to tolower.
(main): Drop useless redeclarations.
* .gitignore: Ignore more built files.
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/grep.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -802,7 +802,7 @@ print_line_middle (const char *beg, const char *lim, /* This can't possibly be correct with UTF-8, but it's equivalent to what was there so far. */ while (--i >= 0) - buf[i] = tolower(beg[i]); + buf[i] = tolower((unsigned char) beg[i]); } else { @@ -1830,8 +1830,6 @@ main (int argc, char **argv) int opt, cc, status; int default_context; FILE *fp; - extern char *optarg; - extern int optind; initialize_main (&argc, &argv); set_program_name (argv[0]); |