diff mbox

New hpux fix to add noreturn attribute to longjmp declarations in setjmp.h

Message ID 13A93BA9-9EC0-4BDD-8D7E-440808F6C334@bell.net
State New
Headers show

Commit Message

John David Anglin Aug. 13, 2016, 4:55 p.m. UTC
Currently, trunk fails to boot fortran on hpux because of the following error:

/xxx/gnu/gcc/objdir/./prev-gcc/xg++ -B/xxx/gnu/gcc/objdir/./prev-gcc/ -B/opt/gnu64/gcc/gcc-7/hppa64-hp-hpux11.00/bin/ -nostdinc++ -B/xxx/gnu/gcc/objdir/prev-hppa64-hp-hpux11.00/libstdc++-v3/src/.libs -B/xxx/gnu/gcc/objdir/prev-hppa64-hp-hpux11.00/libstdc++-v3/libsupc++/.libs  -I/xxx/gnu/gcc/objdir/prev-hppa64-hp-hpux11
.00/libstdc++-v3/include/hppa64-hp-hpux11.00  -I/xxx/gnu/gcc/objdir/prev-hppa64-
hp-hpux11.00/libstdc++-v3/include  -I/xxx/gnu/gcc/gcc/libstdc++-v3/libsupc++ -L/xxx/gnu/gcc/objdir/prev-hppa64-hp-hpux11.00/libstdc++-v3/src/.libs -L/xxx/gnu/gc
c/objdir/prev-hppa64-hp-hpux11.00/libstdc++-v3/libsupc++/.libs -fno-PIE -c  -DIN
_GCC_FRONTEND -g -O2 -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwin
d-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-at
tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -Ifortran -I../../gc
c/gcc -I../../gcc/gcc/fortran -I../../gcc/gcc/../include -I../../gcc/gcc/../libc
pp/include -I/opt/gnu64/gcc/gmp/include  -I../../gcc/gcc/../libdecnumber -I../..
/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace  
 -o fortran/parse.o -MT fortran/parse.o -MMD -MP -MF fortran/.deps/parse.TPo ../
../gcc/gcc/fortran/parse.c
../../gcc/gcc/fortran/parse.c: In function 'void unexpected_eof()':
../../gcc/gcc/fortran/parse.c:2618:1: error: 'noreturn' function does return [-W
error]

The attached patch fixes the above by adding the noreturn attribute to the "longjmp" declarations in setjmp.h.

Okay for trunk?

Dave
--
John David Anglin	dave.anglin@bell.net
2016-08-13  John David Anglin  <danglin@gcc.gnu.org>

	* inclhack.def (hpux_longjmp): New fix.
	* fixincl.x: Regenerate.
	* tests/base/setjmp.h: New test file.

Comments

Bruce Korb Aug. 13, 2016, 5:45 p.m. UTC | #1
Looks good to me.

On Sat, Aug 13, 2016 at 9:55 AM, John David Anglin <dave.anglin@bell.net> wrote:
> Currently, trunk fails to boot fortran on hpux because of the following error:
>
> /xxx/gnu/gcc/objdir/./prev-gcc/xg++ -B/xxx/gnu/gcc/objdir/./prev-gcc/ -B/opt/gnu64/gcc/gcc-7/hppa64-hp-hpux11.00/bin/ -nostdinc++ -B/xxx/gnu/gcc/objdir/prev-hppa64-hp-hpux11.00/libstdc++-v3/src/.libs -B/xxx/gnu/gcc/objdir/prev-hppa64-hp-hpux11.00/libstdc++-v3/libsupc++/.libs  -I/xxx/gnu/gcc/objdir/prev-hppa64-hp-hpux11
> .00/libstdc++-v3/include/hppa64-hp-hpux11.00  -I/xxx/gnu/gcc/objdir/prev-hppa64-
> hp-hpux11.00/libstdc++-v3/include  -I/xxx/gnu/gcc/gcc/libstdc++-v3/libsupc++ -L/xxx/gnu/gcc/objdir/prev-hppa64-hp-hpux11.00/libstdc++-v3/src/.libs -L/xxx/gnu/gc
> c/objdir/prev-hppa64-hp-hpux11.00/libstdc++-v3/libsupc++/.libs -fno-PIE -c  -DIN
> _GCC_FRONTEND -g -O2 -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwin
> d-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-at
> tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -Ifortran -I../../gc
> c/gcc -I../../gcc/gcc/fortran -I../../gcc/gcc/../include -I../../gcc/gcc/../libc
> pp/include -I/opt/gnu64/gcc/gmp/include  -I../../gcc/gcc/../libdecnumber -I../..
> /gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace
>  -o fortran/parse.o -MT fortran/parse.o -MMD -MP -MF fortran/.deps/parse.TPo ../
> ../gcc/gcc/fortran/parse.c
> ../../gcc/gcc/fortran/parse.c: In function 'void unexpected_eof()':
> ../../gcc/gcc/fortran/parse.c:2618:1: error: 'noreturn' function does return [-W
> error]
>
> The attached patch fixes the above by adding the noreturn attribute to the "longjmp" declarations in setjmp.h.
>
> Okay for trunk?
>
> Dave
> --
> John David Anglin       dave.anglin@bell.net
>
diff mbox

Patch

Index: inclhack.def
===================================================================
--- inclhack.def	(revision 239324)
+++ inclhack.def	(working copy)
@@ -2642,6 +2642,21 @@ 
 };
 
 /*
+ *  Add noreturn attribute to longjmp declarations in hpux <setjmp.h>
+ */
+fix = {
+    hackname = hpux_longjmp;
+    mach     = "*-hp-hpux*";
+    files    = setjmp.h;
+    select   = "^[ \t]*extern[ \t]+void.*longjmp[ \t]+__\\(\\(.*int\\)\\)";
+
+    c_fix     = format;
+    c_fix_arg = "%0 __attribute__ ((__noreturn__))";
+
+    test_text = 'extern void	longjmp __((jmp_buf, int));';
+};
+
+/*
  *  Fix hpux10.20 <sys/time.h> to avoid invalid forward decl
  */
 fix = {
--- /dev/null	2016-08-13 12:36:13 -0400
+++ tests/base/setjmp.h	2016-08-10 09:41:48 -0400
@@ -0,0 +1,14 @@ 
+/*  DO NOT EDIT THIS FILE.
+
+    It has been auto-edited by fixincludes from:
+
+	"fixinc/tests/inc/setjmp.h"
+
+    This had to be done to correct non-standard usages in the
+    original, manufacturer supplied header file.  */
+
+
+
+#if defined( HPUX_LONGJMP_CHECK )
+extern void	longjmp __((jmp_buf, int)) __attribute__ ((__noreturn__));
+#endif  /* HPUX_LONGJMP_CHECK */