Bug 20594 - Compile error on GCC 6.1.1: misleading indentation
Summary: Compile error on GCC 6.1.1: misleading indentation
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-09 12:55 UTC by Alain Kalker
Modified: 2016-09-09 14:12 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alain Kalker 2016-09-09 12:55:08 UTC
On Arch Linux x86_64, using GCC 6.1.1, after building SystemTap from Git master (currently at commit e37c415) without problems, I'm getting this compile error when I try and run a script:

stap /usr/share/doc/systemtap/examples/general/para-callgraph-verbose.stp 'process("./fac").function("*")' -c ./fac
WARNING: function _start return probe is blacklisted: keyword at /usr/share/doc/systemtap/examples/general/para-callgraph-verbose.stp:24:1
 source: probe $1.return { trace(-1, $$return) }
         ^
In file included from /tmp/stapUJK0D2/stap_fb3d8173b0fe66e9a260010966657275_12523_src.c:307:0:
/usr/share/systemtap/runtime/map.c: In function ‘_new_map_copy_stat’:
/usr/share/systemtap/runtime/map.c:479:3: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
   if (sd2->max > sd1->max)
   ^~
/usr/share/systemtap/runtime/map.c:481:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
    sd1->shift = sd2->shift;
    ^~~
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:289: /tmp/stapUJK0D2/stap_fb3d8173b0fe66e9a260010966657275_12523_src.o] Error 1
make: *** [Makefile:1457: _module_/tmp/stapUJK0D2] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]

I would like to recommend building and testing SystemTap with modern versions of GCC, the new warnings and errors are quite helpful in catching bugs.

Kind regards,

Alain
Comment 1 Frank Ch. Eigler 2016-09-09 14:12:57 UTC
Thanks for the report!  Fixed as per commit 0ec5ddf57, as per gcc 6.2.1 on fedora rawhide.