|
From: Stephen W. <st...@ic...> - 2008-04-28 21:24:20
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Larry Doolittle wrote:
| I can "fix" the code to match 21st century compiler pedantry, in a
| number of ways. Please tell me if any of the following code fragments
| targeted at vpi_chk_error() meet your aesthetic needs:
|
| static char error_code[]="";
| info->code = error_code;
|
| static char *error_code=NULL;
| if (error_code == NULL) error_code=strdup("");
| info->code = error_code;
|
| info->code = strdup("");
#3 is clearly out.
I perfer #1, personally. Is dmalloc/efence really going to be
somehow confused by #1, and will #2 really trigger them to do
anything special?
- --
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFIFkB+rPt1Sc2b3ikRAuKgAKCya0EyNDHByRt/za4V9siCRXbq1ACdF+uf
Iz7ldVUOXRn9ImEIXVFAzYE=
=kVdg
-----END PGP SIGNATURE-----
|