Skip to content

IDE buries warnings where users can easily miss them #1215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dave2 opened this issue Jan 12, 2013 · 3 comments
Closed

IDE buries warnings where users can easily miss them #1215

dave2 opened this issue Jan 12, 2013 · 3 comments
Assignees
Labels
Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix)
Milestone

Comments

@dave2
Copy link

dave2 commented Jan 12, 2013

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.

@matthijskooijman
Copy link
Collaborator

Currently, the compiler does not show warnings at all (See #1728). After that one is fixed, I think this one should be fixed as well.

@ffissore ffissore added the New label Feb 27, 2014
@cmaglie cmaglie removed the New label Feb 27, 2014
@RichardNeill
Copy link

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.

@ffissore
Copy link
Contributor

Fixed with b42c666

@ffissore ffissore added this to the Release 1.6.5 milestone May 26, 2015
@ffissore ffissore self-assigned this May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

No branches or pull requests

5 participants