Bug 82510 - C compiler ignores user definition of log
Summary: C compiler ignores user definition of log
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.8.5
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-10 22:49 UTC by Doug Wiedemann
Modified: 2017-10-11 02:03 UTC (History)
0 users

See Also:
Host: x86_64 linux
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
compile with "gcc -O0 log-bug.c" - it should print 2.5 when run. (172 bytes, text/x-csrc)
2017-10-10 22:49 UTC, Doug Wiedemann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Doug Wiedemann 2017-10-10 22:49:59 UTC
Created attachment 42338 [details]
compile with "gcc -O0 log-bug.c" - it should print 2.5 when run.

When I define my own "log" function in a C program the one defined in math.h
is used, even when I don't include math.h.
Comment 1 Andrew Pinski 2017-10-11 02:03:01 UTC
Use -fno-builtins as log as an identifier is reserved.
Comment 2 Andrew Pinski 2017-10-11 02:03:08 UTC
Use -fno-builtins as log as an identifier is reserved.