Tootfinder

Opt-in global Mastodon full text search. Join the index!

@joxean@mastodon.social
2026-04-21 16:07:51

C question: I never use const for POD datatypes, except, maybe, for functions. Does it make sense for you to do something like this:
void foo(void)
{
const int x = 32;
// Do stuff
}
Do you do this? Why?
#cpp

@smurthys@hachyderm.io
2026-03-12 10:31:01

I was messing with the C comma operator and ran into an old trivial bug in #GCC diagnostics. Interesting that the error remains from at least GCC 4.7 but morphed a bit in GCC 9.1.
int a=0, b=5, c=7;
return a, b, c; //says a and c are unused
#cpp #bug #FOSS