[PATCH 4/5] cgcc: teach about '-o <file>'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 cgcc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/cgcc b/cgcc
index 33c2ba974..400044253 100755
--- a/cgcc
+++ b/cgcc
@@ -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$/;
-- 
2.19.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux