Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
why is casting malloc a bad thing?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Michael Wojcik, post: 1697973"] I am continually amazed at people who think Stroustrop (I assume this is whom you meant) magically gets the last word in this argument. He clearly has an interest in promoting C++, and that very likely includes persuading C programmers to switch. What makes you think he's an impartial observer? For that matter, what makes you think he's right? I have just invented a new language, called "C2", which is exactly like C89 except that all identifiers must be at least 2 characters, because I don't like single-character identifiers. All "good-style C programs" are also C2 programs, which proves that 1) C2 is a "better C", and 2) that avoiding single-character identifiers is "just better style". No, you say? Why is this argument valid for Stroustrop and not for me? What if I did? The same argument (against casting its return value) would appear to apply. I suspect a very small subset of C programmers need to write code which is acceptable to both C89 and pre-C89 implementations, or indeed write for pre-C89 implementations at all. Those who do may indeed need to cast malloc. Their situation is not the common one, nor the one we assume on this newsgroup, which is intended for the discussion of standard C. -- Michael Wojcik [email]michael.wojcik@microfocus.com[/email] What is it with this warm, quiet, nauseating bond between them? -- Rumiko Takahashi, _Maison Ikkoku_, trans. Mari Morimoto, adapt. Gerard Jones [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
why is casting malloc a bad thing?
Top