[Coco] Found strangeness in C compiler (bug)
Gene Heskett
gheskett at shentel.net
Tue May 21 13:32:26 EDT 2019
On Tuesday 21 May 2019 09:23:31 am Allen Huffman wrote:
> > On May 21, 2019, at 8:16 AM, Mathew Boytim via Coco
> > <coco at maltedmedia.com> wrote:
> >
> > ...
> > not strictly legal. We use IAR for a lot of embedded development
> > and the IAR compiler/optimizer is pretty kind in that it seems to do
> > things as you would want or expect but aren't strictly
> > legal/defined. On the other hand I find the gcc compiler/optimizer
> > to be 'greedy' in that it takes advantage of the strict definition
> > when it wants to. I frequently encounter programmers complaining of
> > bugs in gcc because things that they routinely do with IAR don't
> > work with gcc - but in all cases gcc has been right. Matt
>
> I used IAR at a recent job. I know we “complain” about issues with
> these ancient K&R compilers from the 1980s, but I found some odd
> limits in “modern” supported compilers. It was either IAR or Renasas
> that had a cryptic error if you had a string longer than 80 characters
> or something pretty small!
>
> char * string = “If this is too big, it would give you an error that
> you had to look up because it did not make any sense.”;
>
> I guess the biggest thing we’ve gained with modern tools is they have
> much better error reporting, and we can search the web to see what
> they mean.
>
> I am hoping I can slide back into K&R C for updating some of my old
> projects. I assume using ANSIFRONT is going to bloat my code a bit —
> especially if I use things like unsigned char where it puts in “ch &
> 255” everywhere (if I recall).
>
> I guess if ANSIFRONT is standard with NitrOS-9 these days, maybe I
> should just go that route. It sure would be easier.
>
> — Allen
Ansifront has made an awfull lot of code from other sources Just Build
(and Work) for me down thru the years. Take your pick, a 3 to 5% code
bloat and it works, or it upchucks on the first void. I'll take the
bloat.
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
More information about the Coco
mailing list