Re: IS this a proper way of freeing memory with free()
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Sat, 10 Feb 2007 07:53:33 +1300
Richard Heathfield wrote:
Ian Collins said:I'm not sure if you are being deliberately obtuse.
Richard Heathfield wrote:
Ian Collins said:The driver code is C.
Richard Heathfield wrote:
Yevgen Muntyan said:
It's easy to write lot of C code which is valid C++. You have to
apply casts to return value of malloc though.
It's *pointless* to write lots of C code which is valid C++. [...]
It's not pointless if you are using C++ for hardware simulations to
test your C drivers.
If you're using C++ for the hardware simulations, you're using C++,
not C.
Fine, in which case it isn't C++, so you don't need the cast on malloc.
My point is there is sometimes value in having C code which is valid
C++. The driver code in question is compiled as C for the embedded
target, but compiled with the host C++ compiler for testing in a
hardware simulator.
So the code in question is written in the subset of C that is valid C++.
--
Ian Collins.
.
- Follow-Ups:
- Re: IS this a proper way of freeing memory with free()
- From: Richard Bos
- Re: IS this a proper way of freeing memory with free()
- From: Keith Thompson
- Re: IS this a proper way of freeing memory with free()
- From: Christopher Layne
- Re: IS this a proper way of freeing memory with free()
- From: Richard Heathfield
- Re: IS this a proper way of freeing memory with free()
- References:
- IS this a proper way of freeing memory with free()
- From: Raman
- Re: IS this a proper way of freeing memory with free()
- From: Yevgen Muntyan
- Re: IS this a proper way of freeing memory with free()
- From: Yevgen Muntyan
- Re: IS this a proper way of freeing memory with free()
- From: Walter Roberson
- Re: IS this a proper way of freeing memory with free()
- From: Yevgen Muntyan
- Re: IS this a proper way of freeing memory with free()
- From: Christopher Layne
- Re: IS this a proper way of freeing memory with free()
- From: Yevgen Muntyan
- Re: IS this a proper way of freeing memory with free()
- From: Christopher Layne
- Re: IS this a proper way of freeing memory with free()
- From: Yevgen Muntyan
- Re: IS this a proper way of freeing memory with free()
- From: Flash Gordon
- Re: IS this a proper way of freeing memory with free()
- From: Yevgen Muntyan
- Re: IS this a proper way of freeing memory with free()
- From: Mark McIntyre
- Re: IS this a proper way of freeing memory with free()
- From: Yevgen Muntyan
- Re: IS this a proper way of freeing memory with free()
- From: Richard Heathfield
- Re: IS this a proper way of freeing memory with free()
- From: Ian Collins
- Re: IS this a proper way of freeing memory with free()
- From: Richard Heathfield
- Re: IS this a proper way of freeing memory with free()
- From: Ian Collins
- Re: IS this a proper way of freeing memory with free()
- From: Richard Heathfield
- IS this a proper way of freeing memory with free()
- Prev by Date: Re: Initialising Variables
- Next by Date: Re: Is void* vulnerable
- Previous by thread: Re: IS this a proper way of freeing memory with free()
- Next by thread: Re: IS this a proper way of freeing memory with free()
- Index(es):
Relevant Pages
|