Hi folks,
I've spent hours trying to debug this problem and I wonder if it's normal or a
sdcc compiler shortcoming :
I have a function defined as
void myFunc() {
blah;
blah;
}
In my program I had a :
if (complex && conditions) {
blah;
blah;
blah;
} else myFunc;
I noticed that the positive branch of the "if" was properly executed when it
had to, but for some reasons the contents of "myFunc" semt to never be
executed.
I first spent a lot of time checking and debugging the contents of "myFunc" and
found nothing. Then I spent hours debugging the conditions and the "if"
structure and still found nothing.
I finally found out that I was calling "myFunc" instead of "myFunc()" and the
compiler then simply ignored the function call and never performed it, without
a single warning or error message during compilation.
I don't know if it's "normal C behaviour" as I'm not very experienced with C
or if it's a compiler issue, I only know how frustrated I got discovering that
I had lost that much time because of a missing ()...
I would have expected a compiler message about the missing parentheses in the
function call...
So I report it here anyway, just in case... :-\
--
Michel Bouissou (OpenPGP ID 0xEB04D09C)
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user