https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118308
--- Comment #3 from Raffaello Bertini ---
ok thanks for the reply. btw it is enough to enable the warnigs.
```
bool f()
{
printf("f");
}
int main(int argc, char* argv[])
{
if (f())
printf("y");
else
printf("n");
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118308
Bug ID: 118308
Summary: compiling code that should return without a return
statement
Product: gcc
Version: 14.1.0
Status: UNCONFIRMED
Severity: normal
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116767
--- Comment #11 from Raffaello Bertini ---
> MyFunc __attribute__((const)) * g_f = my_func;
> instead. Just with the attribute syntax you get an extra warning:
> warning: ‘const’ attribute on function returning ‘void’ [-Wattributes]
That's f
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116767
--- Comment #9 from Raffaello Bertini ---
More than to fix something,
it was a suggestion to evolve or add a warning to tell the user that those kind
of statements are basically like not written at all, ignored as the final
result.
so more than
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116767
--- Comment #1 from Raffaello Bertini ---
for simplicity sake i am writing here the C sample code:
#include
typedef void MyFunc(void);
const MyFunc my_func;
co
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116767
Bug ID: 116767
Summary: C const function pointer no code generated (or
optimized out)
Product: gcc
Version: 14.2.1
Status: UNCONFIRMED
Severity: normal