Woa! Don't do this! (Mistake in big progmem)

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
const uint8_t Mason[] PROGMEM =
{4418, 2337, 2369, 4546, 4546, 4546, 4546, 10885, 8740, 4514, 6723, 
2305, 6531, 2369, 8772, 6627, 4546, 6627, 12966, 12998, 12966, 2497,
4418, 4546, 480, 448, 4610, 6691, 4610, 6787, 19305, 10949, 6723,
bla bla bla

(There are 7500 numbers there.)

I mistakenly made this uint8_t. Notice that all, or at least most of the numbers are > 255. Studio tries to show 7500 error messages, one for each number.

You will find yourself reaching for the power cord.

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

I thought the compiler gave up once there were more than 100 errors. If not by default I think there's a switch for that.

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

I did some research. There is a way to limit number of errors using "-fmax-errors=N", in which case compilation will terminate with a message "compilation terminated due to -fmax-errors=N.". But there seems to be no way to limit number of warnings.

At the same time, in some contexts GCC automatically suppresses similar warnings and errors. I could not reproduce this on artificial tests, but I'm sure I've seen it in a real development.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

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

Quote:
But there seems to be no way to limit number of warnings.

Even if "treat warnings as errors" is set? (An option that always should be active, IMNSHO.)

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

Once I killed it and got things running again, I corrected the code and it builds in seconds. I was trying to display a photo of Mason on my tft display. Came out a jumble, so I have something mixed. Doesn't really matter as I don't want to use up 15K of flash for a tiny photo of Mason ;)

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.