From 577172e2a52076f4099fcdf4bf8a69649488f514 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 4 Jan 2019 16:37:07 +0100 Subject: errorout: discard disabled warnings. Fix #729 --- src/ghdldrv/ghdldrv.adb | 11 +++++++++-- src/ghdldrv/ghdllocal.adb | 5 ++--- src/ghdldrv/ghdllocal.ads | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src/ghdldrv') diff --git a/src/ghdldrv/ghdldrv.adb b/src/ghdldrv/ghdldrv.adb index a15736222..3cd7c1f74 100644 --- a/src/ghdldrv/ghdldrv.adb +++ b/src/ghdldrv/ghdldrv.adb @@ -603,8 +603,8 @@ package body Ghdldrv is Arg : String; Res : out Option_Res) is - Str : String_Access; Opt : constant String (1 .. Option'Length) := Option; + Str : String_Access; begin Res := Option_Bad; if Opt = "-v" and then Flag_Verbose = False then @@ -687,7 +687,14 @@ package body Ghdldrv is -- compiler_args. null; else - Add_Argument (Compiler_Args, new String'(Opt)); + if Backend = Backend_Gcc then + -- Prefix options for gcc so that lang.opt does need to be + -- updated when a new option is added. + Str := new String'("--ghdl" & Opt); + else + Str := new String'(Opt); + end if; + Add_Argument (Compiler_Args, Str); end if; Res := Option_Ok; elsif Opt'Length > 18 diff --git a/src/ghdldrv/ghdllocal.adb b/src/ghdldrv/ghdllocal.adb index 030cf118e..5841f1b4f 100644 --- a/src/ghdldrv/ghdllocal.adb +++ b/src/ghdldrv/ghdllocal.adb @@ -56,10 +56,9 @@ package body Ghdllocal is Compile_Init; end Init; - function Decode_Driver_Option (Option : String) return Boolean + function Decode_Driver_Option (Opt : String) return Boolean is - subtype Opt_String is String (1 .. Option'Length); - Opt : Opt_String renames Option; + pragma Assert (Opt'First = 1); begin if Opt = "-v" and then Flag_Verbose = False then Flag_Verbose := True; diff --git a/src/ghdldrv/ghdllocal.ads b/src/ghdldrv/ghdllocal.ads index ff66c4d59..3189c58cc 100644 --- a/src/ghdldrv/ghdllocal.ads +++ b/src/ghdldrv/ghdllocal.ads @@ -25,7 +25,7 @@ package Ghdllocal is -- Handle: -- --std=xx, --work=xx, -Pxxx, --workdir=x, --ieee=x, -Px, and -v - function Decode_Driver_Option (Option : String) return Boolean; + function Decode_Driver_Option (Opt : String) return Boolean; type Command_Lib is abstract new Command_Type with null record; -- cgit v1.2.3