Re: why is casting malloc a bad thing?
From: Dan Pop (Dan.Pop_at_cern.ch)
Date: 01/30/04
- Next message: pete: "Re: difference"
- Previous message: Dan Pop: "Re: Question re. integral promotion, signed->unsigned"
- In reply to: Sidney Cadot: "Re: why is casting malloc a bad thing?"
- Next in thread: Sidney Cadot: "Re: why is casting malloc a bad thing?"
- Reply: Sidney Cadot: "Re: why is casting malloc a bad thing?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Jan 2004 16:54:04 GMT
In <bvdkd5$7ar$2@news.tudelft.nl> Sidney Cadot <sidney@jigsaw.nl> writes:
>Daniel Haude wrote:
>
>> On Thu, 29 Jan 2004 01:08:46 +0100,
>> Sidney Cadot <sidney@jigsaw.nl> wrote
>> in Msg. <bv9iug$lup$1@news.tudelft.nl>
>>
>>>That way, I don't have to rely on the semantics of C with regard to
>>>allowing void*-to-any* assignments,
>>
>>
>> When programming in C you have to rely on the semantics of C with regard
>> to pretty much anything.
>
>Not at all. For example, I do not have to rely on the semantics of
>trigraphs, since I avoid them like the plague.
You may still inadvertently fall upon them, if you're not extremely
careful. E.g.
puts("Huh??!");
This is more of an issue when automatically encoding binary data in
string literals (e.g. using a base64-style algorithm) that are supposed
to be used by C programs. You *must* check that you're not inadvertently
inserting a trigraph sequence in that string literal.
See, their semantics are haunting even the trigraph haters...
Dan
-- Dan Pop DESY Zeuthen, RZ group Email: Dan.Pop@ifh.de
- Next message: pete: "Re: difference"
- Previous message: Dan Pop: "Re: Question re. integral promotion, signed->unsigned"
- In reply to: Sidney Cadot: "Re: why is casting malloc a bad thing?"
- Next in thread: Sidney Cadot: "Re: why is casting malloc a bad thing?"
- Reply: Sidney Cadot: "Re: why is casting malloc a bad thing?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|