A dummy's C tip number 342

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you've just added a function to your program, and suddenly you're getting compiler errors in other places that have nothing to do with the new function, you might have forgotten to put the semicolon in the .h file for the new function

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

C generates such "interesting" messages as the result of relatively minor syntax errors. I'm pretty sure I've used other compilers (PL/C?) that were able to suggest "missing a semicolon" - I wonder if that's just impossible given the C language definition, or whether it's just something that no one has ever worked on very much?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have long been told:

Quote:
If you cannot make sense of an error message on the indicated line, look at the previous line.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

An especially annoying "feature" of gcc is that sometimes, I can't tell you when,
a missing header file gets a warning instead of an error.
Of course, everything that needed the mispelt header gets an error message.

Iluvatar is the better part of Valar.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IAR has the nice habit of generating a slew of errors from one defect.

I've been using phpstorm of late and it hints as to where problems are ( in php at least ) does intellisense do such things? Not having really used AS6, i don't know.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
I have long been told:
Quote:
If you cannot make sense of an error message on the indicated line, look at the previous line.

Or previous lines.

And note that "previous lines" may be in a header...

Similarly, one error can lead to very many consequent errors - so always start with the first error in the file.
(not so easy with Atmel Studio and similar IDEs which try to be "helpful" (sic) by sorting errors)

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

Similarly, one error can lead to very many consequent errors - so always start with the first error in the file.
(not so easy with Atmel Studio and similar IDEs which try to be "helpful" (sic) by sorting errors)

I've noticed that! Sometimes the error that caused the others is farther down in the list.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Another reason to know that the complete build output (in the order executed, based on the dependencies in the project) is accessible on the Output tab.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

does intellisense do such things? Not having really used AS6, i don't know.

Not Intellisense - but Naggy does - it's an optional extension but one everyone should have installed and use. Also get Dean/Morten's "Margin of Error" extension.