discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* man_validate.c compile errors on Linux gcc/clang
@ 2019-03-13  1:32 Stephen Gregoratto
  2019-03-13 18:38 ` Ingo Schwarze
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Gregoratto @ 2019-03-13  1:32 UTC (permalink / raw)
  To: discuss

The latest patches to man_validate.c do not compile on my Linux machines 
using gcc/clang. Only my OpenBSD server can complete fully.

On my Arch Linux machine:

Linux 5.0.0-arch1-1-ARCH x86_64 GNU/Linux

gcc -g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter   -c -o man_validate.o man_validate.c
man_validate.c:44:14: error: expected ‘;’ before ‘void’
 static __dead void check_abort(CHKARGS);
              ^~~~~
              ;
man_validate.c:199:14: error: expected ‘;’ before ‘void’
 static __dead void
              ^~~~~
              ;
make: *** [<builtin>: man_validate.o] Error 1

gcc (GCC) 8.2.1 20181127
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


clang -g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter   -c -o man_validate.o man_validate.c
man_validate.c:44:8: error: unknown type name '__dead'
static __dead void check_abort(CHKARGS);
       ^
man_validate.c:44:15: error: expected identifier or '('
static __dead void check_abort(CHKARGS);
              ^
man_validate.c:67:2: error: use of undeclared identifier 'check_abort'
        check_abort,/* LP */
        ^
man_validate.c:69:2: error: use of undeclared identifier 'check_abort'
        check_abort,/* P */
        ^
man_validate.c:199:8: error: unknown type name '__dead'
static __dead void
       ^
man_validate.c:199:15: error: expected identifier or '('
static __dead void
              ^
6 errors generated.
make: *** [<builtin>: man_validate.o] Error 1

clang version 7.0.1 (tags/RELEASE_701/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

On my Debian 9 Server:

Linux mail.sgregoratto.me 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3 (2019-02-02) x86_64 GNU/Linux

gcc -g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter   -c -o man_validate.o man_validate.c
man_validate.c:44:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
 static __dead void check_abort(CHKARGS);
               ^~~~
man_validate.c:67:2: error: ‘check_abort’ undeclared here (not in a function)
  check_abort,/* LP */
  ^~~~~~~~~~~
man_validate.c:199:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
 static __dead void
               ^~~~
<builtin>: recipe for target 'man_validate.o' failed
make: *** [man_validate.o] Error 1

gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.

I'm unsure if __dead is defined in glibc. I couldn't find it under 
<sys/cdefs/h>.
-- 
Stephen Gregoratto
PGP: 3FC6 3D0E 2801 C348 1C44 2D34 A80C 0F8E 8BAB EC8B
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-14 11:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-13  1:32 man_validate.c compile errors on Linux gcc/clang Stephen Gregoratto
2019-03-13 18:38 ` Ingo Schwarze
2019-03-14  1:11   ` Stephen Gregoratto
2019-03-14  1:30     ` Stephen Gregoratto
2019-03-14 11:45     ` Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).