diff options
-rw-r--r-- | doc/using/InvokingGHDL.rst | 1 | ||||
-rw-r--r-- | src/vhdl/vhdl-errors.adb | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/doc/using/InvokingGHDL.rst b/doc/using/InvokingGHDL.rst index 6846b1b3e..4deb96b7f 100644 --- a/doc/using/InvokingGHDL.rst +++ b/doc/using/InvokingGHDL.rst @@ -344,6 +344,7 @@ Options .. WARNING:: This option is not set by default. I don't think this option is a good feature, because it breaks the encapsulation rule. When set, an operator can be silently overridden in another package. You'd do better to fix your design and use the ``numeric_std`` package. +.. option:: -frelaxed .. option:: -frelaxed-rules Within an object declaration, allow references to the name (which references the hidden declaration). This ignores the error in the following code: diff --git a/src/vhdl/vhdl-errors.adb b/src/vhdl/vhdl-errors.adb index c05fa3265..313326c0f 100644 --- a/src/vhdl/vhdl-errors.adb +++ b/src/vhdl/vhdl-errors.adb @@ -110,6 +110,8 @@ package body Vhdl.Errors is Report_Msg (Msgid_Error, Semantic, +Loc, Msg, (1 => Arg1)); end Error_Msg_Sem; + Relaxed_Hint_Done : Boolean := False; + procedure Error_Msg_Relaxed (Origin : Report_Origin; Id : Msgid_Warnings; Msg : String; @@ -127,6 +129,14 @@ package body Vhdl.Errors is Level := Msgid_Error; end if; Report_Msg (Level, Origin, +Loc, Msg, Args); + if not Relaxed_Hint_Done and then Level = Msgid_Error then + Report_Msg + (Msgid_Note, Origin, +Loc, + "(you can use -frelaxed to turn this error into a warning)"); + -- Emit the message only once, although it applies for many error. + -- Maybe do it once per Id ? + Relaxed_Hint_Done := True; + end if; end Error_Msg_Relaxed; procedure Error_Msg_Sem_Relaxed (Loc : Iir; |