[OT] C pointers: BSD versus Linux?
dillon at apollo.backplane.com
Wed May 31 13:24:27 PDT 2006
:Hi compiler/OS gurus,
:Please consider this trivial fragment of c code which I've
:written in two different styles:
:My puzzle is this: on *BSD these two different styles work
:identically -- but on my linux boxes Style 1 produces a
:run-time error, while Style 2 works as expected.
:Anyone here know why this difference?
:Thanks for any clues!
Well, the first bit of code is illegal. The 't' pointer has to point
to something. e.g.:
time_t *t = &blah;
With that fixed, both styles work fine under either Linux or BSD. You
do have to #include <time.h>, of course.
<dillon at xxxxxxxxxxxxx>
More information about the Users