You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The IDE buries warnings even in verbose mode in a way that makes it non-obvious to new users they have issues they may want to consider.
For example, the code
int *ref(int len) {
int buf[len];
return buf;
}
will generate a g++ warning (since it is returning a reference to a stack variable which goes out of scope, something not obvious as wrong to a new user), but without verbose enabled and without trawling back through the output, there is no indication to the user anything is wrong. The compilation finishes looking like it's perfectly fine.
If g++ or other compile components generate warnings, these should be presented to the user explicitly, even with verbose off. For example, it should say "Done Compiling (with warnings)", and output just the warnings themselves in the output window at the end.
The text was updated successfully, but these errors were encountered:
I've just been teaching a beginner, and a really common error is to confuse assignment and tests, like:
"if (x = 3)"
instead of
"if (x == 3)".
However, by default, the IDE silently accepts this.
If I turn on verbose output within the preferences, I do see a warning, but also lots of totally irrelevant things. However, compiler warnings should always be on (and in the default).
Personally, I think that this line of code should be an error, and we should use "-Wall -Werror" by default. However, at the very least, can we have a preferences option that just turns on Warnings, without also turning on all the verbose debugging info.
(For beginners, I would argue to go one step further than GCC: any line containing "if" and a single "=" should be fatal); it should also link to a better explanation of why.
The IDE buries warnings even in verbose mode in a way that makes it non-obvious to new users they have issues they may want to consider.
For example, the code
will generate a g++ warning (since it is returning a reference to a stack variable which goes out of scope, something not obvious as wrong to a new user), but without verbose enabled and without trawling back through the output, there is no indication to the user anything is wrong. The compilation finishes looking like it's perfectly fine.
If g++ or other compile components generate warnings, these should be presented to the user explicitly, even with verbose off. For example, it should say "Done Compiling (with warnings)", and output just the warnings themselves in the output window at the end.
The text was updated successfully, but these errors were encountered: