Bug 1211845 - gcc does not report the warning -Wmaybe-uninitialized
Summary: gcc does not report the warning -Wmaybe-uninitialized
Status: RESOLVED UPSTREAM
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Development (show other bugs)
Version: Current
Hardware: x86-64 openSUSE Tumbleweed
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL: https://gcc.gnu.org/wiki/Better_Unini...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-31 07:51 UTC by Christopher Yeleighton
Modified: 2023-05-31 08:24 UTC (History)
0 users

See Also:
Found By: Community User
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Yeleighton 2023-05-31 07:51:05 UTC
# The following script fails for me:
! echo >foo.c 'void *foo (int q)  { void *r; if (q) r = 0; return r; }' ||
! gcc -c -O -Wall -Werror foo.c
# There should be a warning [-Wmaybe-uninitialized].
Comment 1 Christopher Yeleighton 2023-05-31 08:24:20 UTC
CCP (Conditional Constant Propagation) assumes any value for an uninitialized variable, effectively removing uninitialized uses before the second phase can detect them.