Compilation warnings -- rebase #1

Open
opened 2019-07-04 20:57:02 +02:00 by tobast · 1 comment
Owner

With recent gcc, this repository in the context of Linux v4.17-rc5 fails to build with three warnings (treated as errors):

In file included from /usr/include/string.h:494,
                 from /home/user/DWARF/speedup/perf-linux-tree/tools/perf/util/debug.h:7,
                 from util/cpumap.h:10,
                 from util/evsel.h:12,
                 from util/evlist.h:13,
                 from util/parse-events.c:13:
In function 'strncpy',
    inlined from 'print_symbol_events' at util/parse-events.c:2318:4:
/usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 100 equals destination size [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
    inlined from 'print_symbol_events' at util/parse-events.c:2318:4,
    inlined from 'print_events' at util/parse-events.c:2361:2:
/usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 100 equals destination size [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'strncpy',
    inlined from 'print_symbol_events' at util/parse-events.c:2318:4,
    inlined from 'print_events' at util/parse-events.c:2364:2:
/usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 100 equals destination size [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

This can most probably be fixed by rebasing the repo on top of a recent perf and a more recent Linux context.

With recent `gcc`, this repository in the context of Linux `v4.17-rc5` fails to build with three warnings (treated as errors): ``` In file included from /usr/include/string.h:494, from /home/user/DWARF/speedup/perf-linux-tree/tools/perf/util/debug.h:7, from util/cpumap.h:10, from util/evsel.h:12, from util/evlist.h:13, from util/parse-events.c:13: In function 'strncpy', inlined from 'print_symbol_events' at util/parse-events.c:2318:4: /usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 100 equals destination size [-Werror=stringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'strncpy', inlined from 'print_symbol_events' at util/parse-events.c:2318:4, inlined from 'print_events' at util/parse-events.c:2361:2: /usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 100 equals destination size [-Werror=stringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'strncpy', inlined from 'print_symbol_events' at util/parse-events.c:2318:4, inlined from 'print_events' at util/parse-events.c:2364:2: /usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 100 equals destination size [-Werror=stringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ``` This can most probably be fixed by rebasing the repo on top of a recent `perf` and a more recent Linux context.
Author
Owner

Workaround: EXTRA_CFLAGS=-Wno-stringop-truncation make

Workaround: `EXTRA_CFLAGS=-Wno-stringop-truncation make`
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: m2-internship/perf-eh_elf#1
No description provided.