Pass gcc the -Wall command line switch, it'll throw a warning :)
Jason
geoffveale wrote:
> I think that I may have found the error in my code. I have corrected
> the error and will test it over the next few hours.
>
> My code uses a 1D array of integers to save the value of (volts x 10).
> I have a subroutine that accesses the ADC to carry out a voltage
> measurement and it was returning a float. A very rough example of some
> similar code is as below..
>
> main{
> int battery_volts[1024];
>
> various other code..
>
> battery_volts[x] = check_battery();
>
> return;
> }
>
> float check_battery(){
> various code..
> return((float) value)
> }
>
> The strange thing is that the gnu compiler did not signal an error
> when I was passing a float value to an integer array. I have noticed
> the compiler seems very fussy about types when comparing values or
> formatting for output but this one went past without a blip.
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|