https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102539
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID CC| |msebor at gcc dot gnu.org Status|NEW |RESOLVED --- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- -Wmaybe-uninitialized was enhanced to warn when a pointer to uninitialized memory is passed to a function taking a const-qualified pointer: ... In addition, passing a pointer (or in C++, a reference) to an uninitialized object to a const-qualified function argument is also diagnosed by this warning. That's also what seems to happen in the test case. I get slightly different output but the essence of the warning seems the same: $ gcc -O2 -S -Wall -fdump-tree-uninit -fno-strict-aliasing pr102539.c fabric/clustering.c: In function ‘msg_succession_list_field_set.constprop’: fabric/clustering.c:3750:2: warning: ‘<unknown>’ may be used uninitialized [-Wmaybe-uninitialized] In file included from fabric/clustering.c:36: /home/slyfox/dev/git/nixpkgs/source/cf/include/msg.h:195:6: note: by argument 3 of type ‘const uint8_t *’ {aka ‘const unsigned char *’} to ‘msg_set_buf’ declared here tmp$ /build/gcc-master/gcc/xgcc -B /build/gcc-master/gcc -O2 -S -Wall -fdump-tree-uninit -fno-strict-aliasing -std=gnu99 pr102539.c fabric/clustering.c: In function ‘msg_succession_list_field_set.constprop’: fabric/clustering.c:3750:2: warning: ‘<unknown>’ may be used uninitialized [-Wmaybe-uninitialized] In file included from fabric/clustering.c:36: /home/slyfox/dev/git/nixpkgs/source/cf/include/msg.h:195:6: note: by argument 3 of type ‘const uint8_t *’ {aka ‘const unsigned char *’} to ‘msg_set_buf’ declared here The <unknown> is a known cosmetic flaw with some middle end warnings. It should be fixed but we don't need to keep track of it here.