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>
This page took 0.024191 seconds and 4 git commands to generate.