diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-11-22 23:38:34 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-11-24 18:02:35 +0100 |
commit | c118480c756badbc477356b4f83c126eca6ea1f7 (patch) | |
tree | 0e1e2311227e37709bb1a020d2e49eab6ea0506e | |
parent | 7bd25cdec3ffd4611540d56bd3470f66fb866ff2 (diff) | |
download | sparse-c118480c756badbc477356b4f83c126eca6ea1f7.tar.gz |
cgcc: teach about '-o <file>'
The option '-o', in itself, doesn't need to be handled
specially by cgcc but this option takes an argument and
option arguments need to be ignored by cgcc (otherwise
they can be interpreted and filtered-out by cgcc).
Avoid potential problems with -o's argument by simply
ignoring it.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rwxr-xr-x | cgcc | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -31,6 +31,14 @@ while (@ARGV) { # Ditto for stdin. $do_check = 1 if $_ eq '-'; + if ($_ eq '-o') { + # Need to be checked explicitly since '-o -' is + # sometimes used and the '-' would otherwise be + # processed as an option. + die ("$0: missing argument for $_") if !@ARGV; + $nargs = 1; + } + $m32 = 1 if /^-m32$/; $m64 = 1 if /^-m64$/; $gendeps = 1 if /^-M$/; |