discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Stephen Gregoratto <dev@sgregoratto.me>
To: discuss@mandoc.bsd.lv
Subject: man_validate.c compile errors on Linux gcc/clang
Date: Wed, 13 Mar 2019 12:32:35 +1100	[thread overview]
Message-ID: <20190313013235.najhyodv2hpboasu@BlackBox> (raw)

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

             reply	other threads:[~2019-03-13  1:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13  1:32 Stephen Gregoratto [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190313013235.najhyodv2hpboasu@BlackBox \
    --to=dev@sgregoratto.me \
    --cc=discuss@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).