Bug#833931: c++: Fail to build when <stdnoreturn.h> and the noreturn keyword is used
- To: 833931@bugs.debian.org
- Subject: Bug#833931: c++: Fail to build when <stdnoreturn.h> and the noreturn keyword is used
- From: Petter Reinholdtsen <pere@hungry.com>
- Date: Thu, 07 Feb 2019 06:54:00 +0100
- Message-id: <[🔎] sa636p0jg93.fsf@meta.reinholdtsen.name>
- Reply-to: Petter Reinholdtsen <pere@hungry.com>, 833931@bugs.debian.org
- In-reply-to: <handler.833931.D833931.1549509205899.notifdone@bugs.debian.org>
- References: <E1gra7r-000G9u-7I@fasolo.debian.org> <2flk2fou2hd.fsf@diskless.uio.no> <handler.833931.D833931.1549509205899.notifdone@bugs.debian.org> <2flk2fou2hd.fsf@diskless.uio.no>
Control: reopen -1
Control: reassign -1 g++-8
Control: found -1 8.2.0-14
I had a look, and this issue still exist with GCC 8.2. Reassigning as
appropriate.
% gcc c++-noreturn.c
c++-noreturn.c: In function 'stop_now':
c++-noreturn.c:10:1: warning: 'noreturn' function does return
}
^
% clang c++-noreturn.c
c++-noreturn.c:10:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
}
^
1 warning generated.
% c++ c++-noreturn.c
c++-noreturn.c:7:1: error: 'noreturn' does not name a type
noreturn void stop_now(int i) // or _Noreturn void stop_now(int i)
^~~~~~~~
c++-noreturn.c: In function 'int main()':
c++-noreturn.c:15:3: error: 'stop_now' was not declared in this scope
stop_now(2);
^~~~~~~~
% c++ --version
c++ (Debian 8.2.0-14) 8.2.0
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.
%
--
Happy hacking
Petter Reinholdtsen
Reply to: