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

2012-11-10 Thread John Rigg
On Fri, Nov 09, 2012 at 03:24:56PM +0100, Muffinman wrote: 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

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

2012-11-10 Thread Robin Gareus
On 11/10/2012 10:35 AM, John Rigg wrote: On Fri, Nov 09, 2012 at 03:24:56PM +0100, Muffinman wrote: 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

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

2012-11-09 Thread Muffinman
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

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

2012-11-09 Thread Paul Davis
On Fri, Nov 9, 2012 at 9:24 AM, Muffinman n...@koster.tk wrote: 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. they are different in C++ as well.

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

2012-11-09 Thread Karl Hammar
Maarten: 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

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

2012-11-09 Thread Paul Davis
On Fri, Nov 9, 2012 at 9:37 AM, Paul Davis p...@linuxaudiosystems.comwrote: On Fri, Nov 9, 2012 at 9:24 AM, Muffinman n...@koster.tk wrote: 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

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

2012-11-08 Thread Muffinman
Hello all, I'm working on a little app utilizing 'lasound' and I've got bassically what I want. However, somewhere there is a fault. Editing a random variable causes a segmentation fault. I've tried gdb but except it telling me where the application crashed (which I already knew) I did not get

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

2012-11-08 Thread Brett McCoy
On Thu, Nov 8, 2012 at 3:42 PM, Muffinman n...@koster.tk wrote: I'm working on a little app utilizing 'lasound' and I've got bassically what I want. However, somewhere there is a fault. Editing a random variable causes a segmentation fault. I've tried gdb but except it telling me where the

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

2012-11-08 Thread Muffinman
On 08-11-12 22:02, Brett McCoy wrote: You never allocate memory for the pointer long *outvl after you create it, but then try to point to a value. You need to use malloc() to initialize the memory for that pointer before you can use it. Thanks!! I believe I have some more reading to do.

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

2012-11-08 Thread Jacob
On 11/08/2012 10:18 PM, Muffinman wrote: On 08-11-12 22:02, Brett McCoy wrote: You never allocate memory for the pointer long *outvl after you create it, but then try to point to a value. You need to use malloc() to initialize the memory for that pointer before you can use it. Thanks!! I