Mercury Bugs - mercury
View Issue Details
0000304mercuryBugpublic2013-11-25 11:152014-01-28 18:51
Reporterwangp 
Assigned Tozs 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000304: gcc caret diagnostics
Descriptiongcc 4.8 added caret diagnostics. mfiltercc filters out "used but never defined" warnings, but the two lines that follow (the source line and the caret) leak are passed through.

A few options:

1. update mfiltercc to detect the presence of caret diagnostic lines
2. pass -fno-caret-diagnostics to appropriate versions of gcc
3. fix the problem that causes the warnings

It appears we could just change this static into extern:

    #define MR_declare_static(label) \
        static void label(void) __asm__("_entry_" MR_STRINGIFY(label))

I only had a quick look but the object file was unchanged.
TagsNo tags attached.
Attached Files

Notes
(0000583)
juliensf   
2013-11-25 12:59   
I have a feeling that Ian(?) tried (3) at some point and that it didn't work due to problems with
shared libraries.
(0000595)
juliensf   
2014-01-07 15:15   
I think for now (i.e the upcoming 14.01 release) option (2) would be the simplest thing to do
here. The configure script already detects the version of GCC being used so arranging this
should be trivial.
(0000601)
juliensf   
2014-01-10 16:00   
Option (2) alone does not appear to be sufficient -- GCC 4.8 has changed more about the error
messages than just adding caret diagnostics.
(0000602)
wangp   
2014-01-10 16:41   
The option is actually -fno-diagnostics-show-caret

What do the problematic error messages look like?
(0000603)
juliensf   
2014-01-10 16:56   
I'll post a build log from that machine shortly. I think the issue here is that GCC 4.8 enables

    -ftrack-macro-expansion=2

by default and we are now getting error messages in terms of the original macros rather
than their expanded form.
(0000606)
juliensf   
2014-01-14 15:50   
I have committed a workaround for this that forces the use of the options

   --ftrack-macro-expansion=0 --fno-diagnostics-show-caret

when non-local gotos are being used and the C compiler is GCC 4.8.X.
(0000624)
zs   
2014-01-28 18:51   
Fix committed jan 21: commit id e94af1a937aa2b052a326eefcfd57949208409ce.

Issue History
2013-11-25 11:15wangpNew Issue
2013-11-25 12:59juliensfNote Added: 0000583
2014-01-07 15:15juliensfNote Added: 0000595
2014-01-10 16:00juliensfNote Added: 0000601
2014-01-10 16:41wangpNote Added: 0000602
2014-01-10 16:56juliensfNote Added: 0000603
2014-01-14 15:50juliensfNote Added: 0000606
2014-01-28 18:51zsNote Added: 0000624
2014-01-28 18:51zsStatusnew => closed
2014-01-28 18:51zsAssigned To => zs
2014-01-28 18:51zsResolutionopen => fixed