Re: [LAD] C - Change in memory causing seg.fault (but why?)

From: Muffinman <news@email-addr-hidden>
Date: Fri Nov 09 2012 - 16:24:56 EET

On 09-11-12 01:58, Jacob wrote:

> And, BTW, pay attention to the "format ‘%i’ expects type ‘int’" type of
> warnings. Using the wrong or omitting required length modifiers can lead
> to segfaults, too. Even if '%d' and '%ld' refer to integers of the same
> size on an i386 platform, on a 64 bit platform they won't and weird
> things can happen if the argument doesn't match the format spec.
>
> Jacob

Yeah, that explains why I didn't get any compiling error on a 32bit
computer and did get on a 64bit one (where I did correct the error).
However, the latter was satisfied with %li. Apparently in c++ there is
no difference between long and long int (as far as I can find through
Google) but for c I could not find much info on a potential difference.

Perhaps the resource provided by Tristan can help with that (@Tristan:
btw, thanks for that). I will go through that in the coming week.

Maarten
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Fri Nov 9 16:15:01 2012

This archive was generated by hypermail 2.1.8 : Fri Nov 09 2012 - 16:15:01 EET