[MINC-development] Small API change suggestion, for C++ compatibility
Andrew Janke
a.janke at gmail.com
Thu Jun 18 01:59:54 EDT 2009
> I know MINC is written in C, but one might want to use its API from C++
> code. There are several functions that take a char* when it seems to me
> they should really take a const char*.
True... (call it history).
> Consider this C++ code:
>
> ---------
> #include "minc.h"
>
> void main (void)
> {
> miattgetstr (0, 0, MIfull_name, 0, NULL);
> }
> ---------
>
> Clearly it is useless, but note the 3rd parameter seems to be a typical
> case, passing one of the MI #defines. Compiled as C++ this warns:
>
> warning: deprecated conversion from string constant to 'char*'
>
> Would you accept a patch adding a bunch of consts? It would be correct
> C and C++.
Well I certainly would and am happy to apply it to CVS.
--
Andrew Janke
(a.janke at gmail.com || http://a.janke.googlepages.com/)
Canberra->Australia +61 (402) 700 883
More information about the MINC-development
mailing list