Bug 17172 - missing warning message when not -O3 or when use function call
Summary: missing warning message when not -O3 or when use function call
Status: RESOLVED DUPLICATE of bug 179
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.4.1
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
Keywords: diagnostic
Depends on:
Reported: 2004-08-24 17:52 UTC by xiaoyi_wu
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: both linux and solaris
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description xiaoyi_wu 2004-08-24 17:52:57 UTC
source code:
#ifdef CALL
void set(int *id) {
    *id = 1;
int main(int argc, char **argv) {
    int id;
    if (argc > 1) {
#ifdef CALL
        id = 1;
    return id;
end of source code
If compile using
gcc -Wall -O3 test.c
it will warn about 'id' might be used uninitialized.
but compile using
gcc -Wall test.c
gcc -Wall -O3 -DCALL test.c
then, no such warning is printed.
I think as long as -Wall is included, it should always warn you.
Comment 1 Andrew Pinski 2004-08-24 18:00:54 UTC
Fixed on the mainline already.
Comment 2 Andrew Pinski 2004-08-25 21:16:41 UTC
Reopening to mark as a dup of ..
Comment 3 Andrew Pinski 2004-08-25 21:16:52 UTC

*** This bug has been marked as a duplicate of 179 ***