Re: Curly bracket question



On Mar 28, 4:20 pm, Martin Griffith <mart_in_med...@xxxxxxxx> wrote:
Doom and Gloom ( and couple glasses of wine).

Last night I just compiled my little project, with the 4k limited
Raisonance C complier for the 8051/2

" missing  }  " it said, you have been naughty

I counted all the brackets, even gave them names, I could not find
where to put it.

I stuck an extra bracket at the end of  main()
It, the ***,  was happy.

But nothing worked, not even
InitLCD, first thing in main().

Raisonance doesn't seem to have much of a back up system, and it cost
me ( on my 60'th birthday) about 5 hours.

Any hints /tips/ goto keil, do not pass go, on the missing bracket
syndrome


The missing brace can hide in one of the header files.

One technique is to binary search for the point where adding the extra
brace fixes things. If it fixes it at the end of main(), try moving
it nearer the beginning of the source file (keeping it outside other
definitions, like routines, structures, or initialization lists). At
some point you'll go too far and you'll get the opposite message
("unexpected left brace") and you'll know the problem is below that
point.

If you discover that the problem is fixed by putting a brace just
after an #include (and not when its on the prior line), the problem
will be in the include.

.


Quantcast