DragonFly BSD
DragonFly users List (threaded) for 2006-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: [OT] C pointers: BSD versus Linux?


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 1 Jun 2006 10:43:52 -0700 (PDT)

:What I see in linux is that the two values are miles apart,
:but in *BSD they differ by only a few bytes.  I *assume* this
:means that in *BSD, t is pointing to a valid memory location
:very close to d, whereas in linux t is pointing to some
:random number.  Does this seem a reasonable idea?
:
:Thanks again for everyone's help.

    Yes.  Because the variables are not initialized, the contents of
    the stack representing the variables is whatever happened to be on
    the stack.

    If you are doing any serious programming I recommend always using:

    -Wall -Wstrict-prototypes

    Which will catch most common programming errors, such as using 
    uninitialized variables.

					-Matt
					Matthew Dillon 
					<dillon@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]