Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
G++ missing warning
#include <stdio.h>
#include <stdlib.h>
int main()
int a, b;
float f, g = 1;
if(rand() < 0.5) {
b = 0;
} else {
b = 5;
for(a = 0; a < b; ++a) {
/* you would expect the following line to trigger a warning "f is used uninitialized"...
but that doesn't happen without optimization (-O)! */
f = f + a;
g += f;
printf("%f\n", g);
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.