Do not use diagnostic pragma when GCC version is lower than 4.6.0
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 4 Jul 2019 18:31:16 +0000 (14:31 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 4 Jul 2019 21:53:58 +0000 (17:53 -0400)
commit193015bb595d8a5500e658a5e0be7370de5d33e3
tree0497790aab37e3ee8b276c150e71a613e88a08ae
parentb5009ed10ca3f85844496ab48d65797b0277c740
Do not use diagnostic pragma when GCC version is lower than 4.6.0

Building on a SLES11 SP4.
  gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973
  bison (GNU Bison) 2.4
  autoconf (GNU Autoconf) 2.69
  automake (GNU automake) 1.15
  GNU Make 3.81

The same would probably happen if using RHEL6 and its default compiler
since it uses GCC 4.4 [1].

The README suggest that we support GCC > 3.2.

Officially the diagnostic pragma are supported starting in 4.6. [2]
But they were present before 4.6 with limitation.

Error encountered:

integer.c: In function 'ctf_integer_read':
integer.c:271: error: #pragma GCC diagnostic not allowed inside functions
integer.c:271: error: #pragma GCC diagnostic not allowed inside functions
integer.c:271: error: #pragma GCC diagnostic not allowed inside functions
integer.c:276: error: #pragma GCC diagnostic not allowed inside functions
integer.c:276: error: #pragma GCC diagnostic not allowed inside functions
integer.c:276: error: #pragma GCC diagnostic not allowed inside functions
integer.c:282: error: #pragma GCC diagnostic not allowed inside functions
integer.c:282: error: #pragma GCC diagnostic not allowed inside functions
integer.c:282: error: #pragma GCC diagnostic not allowed inside functions
integer.c:287: error: #pragma GCC diagnostic not allowed inside functions
integer.c:287: error: #pragma GCC diagnostic not allowed inside functions
integer.c:287: error: #pragma GCC diagnostic not allowed inside functions

[1] https://access.redhat.com/solutions/19458
[2] https://gcc.gnu.org/gcc-4.6/changes.html

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Change-Id: Ie6e4e8bd631f7aab1435fece929621c9a11990e4
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1630
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/compat/bitfield.h
This page took 0.024191 seconds and 4 git commands to generate.