Rajiv Andrade wrote:
> It's better to patch the BSD_CONST definition itself, by including
> SOLARIS in its first conditional at src/include/trousers_types.h.
>
> #if (defined (__linux) || defined (linux) || defined (SOLARIS))
> #define BSD_CONST
> #elif (defined (__OpenBSD__) || defined (__FreeBSD__))
> #define BSD_CONST const
> #endif
>
I agree that this is a better way to modify the definition, but is this
the right definition for Solaris? For that matter, is it correct for the
other platforms?
As far as I can tell, this #define is used only for the second argument
to iconv(), which can be either char ** or const char ** depending on
whether the environment is XPG6-compliant or not. For Solaris, it can be
either (depending on whether _XPG6 is defined or not, naturally).
I *think* it should be OK to call iconv() with an argument of type char
**, even if the function prototype specifies const char **. That's just
a guarantee that iconv() won't modify the contents of the buffer, isn't
it? See strcpy() et al. for similar usage.
Unless I'm missing something (and I may be), the right fix seems to be
just to remove BSD_CONST from the handful of lines where it appears.
Scott
--
Scott Rotondo
Principal Engineer, Solaris Security Technologies
President, Trusted Computing Group
Phone/FAX: +1 408 850 3655 (Internal x68278)
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
TrouSerS-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-tech