On Fri, 11 Feb 2005 15:49:13 -0800, Mike Marion <[EMAIL PROTECTED]> wrote:
> Quoting Mike Marion <[EMAIL PROTECTED]>:
>
> After further study, one of the other guys in my group found that this
> behavior
> only happens when you don't include stdlib.h, which they didn't do in their
> code, and so neither did we in our test snippets. When you include that
> header, it works as you'd expect (though I'd still think it's safer to avoid
> it).
>
> Odd that it compiled at all and didn't error out since getenv() doesn't appear
> to be declared in any other includes.
>
Presumably an undeclared getenv() defaults to returning int.
But it really returns char*. And calls to printf are not checked for
type agreement between the format statement and the rest of the
argument list. I thank that maybe FORTRAN did it better in that
respect.
carl
--
carl lowenstein marine physical lab u.c. san diego
[EMAIL PROTECTED]
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list