cannot report bug: -Wuninitialized not detected when certain function call exists

m2rad0--- via Gcc <[email protected]>
Newsgroups gmane.comp.gcc.devel
Message-ID <[email protected]>
I have been trying to report this bug, but the gcc bug reporting process is currently broken. I sent it to [email protected] and was instructed to make a web account. So when I tried to make an account it gave me an error message saying account creation is closed so I should email [email protected] and it might take 24 hours. Fine, but now more than 3 days later I have not received anything back.

All I want to do is report this bug, so here it is

-Wuninitialized not detected when certain function call exists:

I ran into this issue diagnosing some UB I had foolishly caused. Searched the bugzilla and found some related reports, but none identical to this situation so figured I should fire off an email at least.

possibly related:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107663
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106541
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100126

gcc_15_uninitialized.c:
---
#include <stdio.h>
struct Testing {
        int a;
        int b;
};
void seemingly_unrelated(/*void*/)
{
        printf("seemingly_unrelated(void) doesn't touch 'test' at all!\n");
}
static int func(const struct Testing *test, const int b)
{
        return test->a + b;
}
static int notmain()
{
        // comment this line out to get the expected uninitialized warning
        seemingly_unrelated("side note:", " no warning here either");

        struct Testing test;
        return func(&test, test.b); // uninitialized use of test.b

        // using two structs causes warning, as expected
        //struct Testing not_test;
        //return func(¬_test, test.b);
}
int main(void)
{
        printf("bug won't happen in main()\n");
        printf("a+b == %d\n", notmain());
        return 0;
}
---
The warnings will be caught only when the function call to 'seemingly_unrelated' is removed.

cmdline:
gcc -O0 -g -pedantic -Wall -Wextra -Wconversion -Werror -o test gcc_15_uninitialized.c && ./test

expected output:
gcc_15_uninitialized.c:20:32: error: 'test.b' is used uninitialized [-Werror=uninitialized]
gcc_15_uninitialized.c:20:16: error: 'test' may be used uninitialized [-Werror=maybe-uninitialized]

config:
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-artax-linux-gnu
Configured with: /home/builddir/gcc/gcc-15.2.0/configure --with-sysroot= --prefix=/artax --build=x86_64-artax-linux-gnu --host=x86_64-artax-linux-gnu --target=x86_64-artax-linux-gnu --with-local-prefix=/artax --with-native-system-header-dir=/artax/include --with-gxx-include-dir=/artax/include/c++ --enable-default-ssp --enable-threads=posix --enable-targets=all --enable-languages=c,c++ --disable-nls --disable-libsanitizer --disable-plugin --disable-bootstrap --disable-multilib --disable-lto
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.2.0 (GCC)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.