Page 1 of 1

spot the bug

Posted: Tue May 18, 2010 4:54 pm
by EssEss

Code: Select all

// @warning rolls may occur
static inline void atomic_inc( atomic_t *pValue )
{
  unsigned long msr = atomic_start();
  *pValue++;
  atomic_end( msr );
}
if you need a hint, I think -wall in gcc may give that to you (not tested, simply a guess).

this stands as a good example of why you need to turn on all warnings and turn them into errors

Re: spot the bug

Posted: Tue May 18, 2010 10:42 pm
by Fred
Yep, I fixed a bug in the throttle control code here yesterday by irradicating all the warnings. float cast to unsigned int. correct procedure is to signed int, then unsigned as this is defined. thing works much more smoothly now.

I'm sorry, but I can't read the above code at all. It is incrementing a pointer, though, not the value pointed to, I guess that is the issue? I hate typedefs...

Re: spot the bug

Posted: Tue May 18, 2010 11:31 pm
by EssEss
yep - thats it

Re: spot the bug

Posted: Fri May 21, 2010 7:36 pm
by SleepyKeys
Yep, I have been using that option while coding binutils.

Re: spot the bug

Posted: Sat Mar 23, 2019 8:34 pm
by Huer
I don't like typedef's either. One of the things that irritates me with the arduino ide. Which brings something I have been thinking about. What is everyone's ide of choice? I like Keil but it doesn't support a lot of stuff. Eclipse and atmel studio are cool, but I kinda don't like VS.

Re: spot the bug

Posted: Wed Mar 27, 2019 9:42 am
by Fred
Eclipse for C work on this stuff, though it has been a while. Mostly in Vim recently.

VSCode is pretty decent, amazingly, considering it's from M$ :-D

Re: spot the bug

Posted: Thu Mar 28, 2019 12:15 pm
by Huer
I installed that. Takes a while to load but looks nice. I haven't played with it too much. Out of all of them the goofy Arduino IDE seems to load up the fastest, even though it's java hell.

Re: spot the bug

Posted: Thu Mar 28, 2019 8:07 pm
by Fred
For me, an IDE taking a while to start and burning some RAM isn't a big deal as long as it does good things and is reasonably responsive when you're in it and using it *all day*. Not sure about C in VSCode but someone probably did something for it. Maybe I should give it a whirl, but the C stuff in eclipse is GREAT and I can say that with a decade of CDT experience.

Re: spot the bug

Posted: Sun Mar 31, 2019 1:29 am
by Huer
I'm still IDE hunting. I'm looking for something that is good for old microcontrollers.. Like I have this old Ford EEC-IV brain with an intel 8061 mpu. I can't even find a real datasheet for it. I like this old stuff and want to play with it, but none of my toys do it. If I was doing IOT stuff, everything would be easy.

Re: spot the bug

Posted: Sun Mar 31, 2019 2:53 am
by Fred
IDEs support languages, not tools. Tools support CPUs, and variants of them. If you can find a command line tool to do C or ASM for that CPU then you should be able to make eclipse CDT work with it, AFAIK.