Re: Please clear my doubt
From: Joona I Palaste (palaste_at_cc.helsinki.fi)
Date: 12/02/03
- Next message: Sidney Cadot: "Re: Is C99 the final C? (some suggestions)"
- Previous message: Julian V. Noble: "Re: Scientific Calculation with long double"
- In reply to: Christopher Benson-Manica: "Re: Please clear my doubt"
- Next in thread: Simon Biber: "Re: Please clear my doubt"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 2 Dec 2003 21:48:31 GMT
Christopher Benson-Manica <ataru@nospam.cyberspace.org> scribbled the following:
> Christopher Benson-Manica <ataru@nospam.cyberspace.org> spoke thus:
>> free( a );
>> if( a==NULL )
> ^^^^^^^^^^^^^
> Let me guess, UB?
Yes. (Or not necessarily, if a was originally NULL, in which case it
would be a comparison NULL==NULL, which is perfectly safe.)
But free() can't alter its argument anyway (no C function can), so the
if statement is pointless.
-- /-- Joona Palaste (palaste@cc.helsinki.fi) ------------- Finland --------\ \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/ "'It can be easily shown that' means 'I saw a proof of this once (which I didn't understand) which I can no longer remember'." - A maths teacher
- Next message: Sidney Cadot: "Re: Is C99 the final C? (some suggestions)"
- Previous message: Julian V. Noble: "Re: Scientific Calculation with long double"
- In reply to: Christopher Benson-Manica: "Re: Please clear my doubt"
- Next in thread: Simon Biber: "Re: Please clear my doubt"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]