[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LibIDN code quality suggestions
From: |
Bittner Ede |
Subject: |
LibIDN code quality suggestions |
Date: |
Wed, 19 Oct 2011 10:35:24 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear Development team,
I've tasked at my workplace, to use libidn. I've found some minor
issues with the library
1, the idn-free function (in idn-free.h) misses the EXTERN "C"
- -qualifier, so when I included in the C++, I've get a link error. My
workaround was to include the file with extern "C", but I think it
isnt the preferable way, because all other header in the library do
not need this. I've understand the comaplaints about the idn_free, but
our production enviroment requires cross platform compatible code, so
normal free is not an option for us.
2, all of the idna_* function return int value, but the idna_strerror
takes the Idna_rc enum type as it's input parameter, so I've to
static_cast the return value. This can easily avoided if the function
returns Idna_rc instead of int. (And it will improve code quality as well)
I hope that my suggestion will improve libidn!
Ede Bittner
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk6ei8wACgkQRg1a/GImAJJAbwCaA4InR3cDjjpS5nsyPH1zXqCs
LFMAnA5eWSVGLN8DhrStW6LW0ZzqtaZ3
=8OGN
-----END PGP SIGNATURE-----
- LibIDN code quality suggestions,
Bittner Ede <=