Bug 1211845

Summary: gcc does not report the warning -Wmaybe-uninitialized
Product: [openSUSE] openSUSE Tumbleweed Reporter: Christopher Yeleighton <giecrilj>
Component: DevelopmentAssignee: E-mail List <screening-team-bugs>
Status: RESOLVED UPSTREAM QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Tumbleweed   
URL: https://gcc.gnu.org/wiki/Better_Uninitialized_Warnings#problem_ccp
See Also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18501
Whiteboard:
Found By: Community User Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

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.