This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82466] New: Missing warning for re-declaration of built-in function as variable
- From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 07 Oct 2017 18:24:52 +0000
- Subject: [Bug c++/82466] New: Missing warning for re-declaration of built-in function as variable
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82466
Bug ID: 82466
Summary: Missing warning for re-declaration of built-in
function as variable
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: bernd.edlinger at hotmail dot de
Target Milestone: ---
cat test.cc
int printf;
int
main()
{
__builtin_printf("%f\n", 3.14);
}
gcc -Wall -Wextra test.cc
./a.out
Segmentation fault (core dumped)
OTOH:
gcc -x c test.cc
test.cc:1:5: warning: built-in function 'printf' declared as non-function
int printf;
^~~~~~
So C++ should print a warning like C.