This is not related to gnulib strictly, but I'd like to consult the
wisdom on this list.  I'm considering changing the argument to some
functions in GNU Libidn from 'enum' to 'int' to silence C++ warnings
(see [1] for discussion).  The change I'm considering is from:

  typedef enum
  {
...
  } Idna_rc;
...
  extern IDNAPI const char *idna_strerror (Idna_rc rc);

into

  extern IDNAPI const char *idna_strerror (int rc);

Some things that I wonder:

1) Is there any platform where this has any implications for the ABI?

1b) Any reasonable platform?

2) Are there any other negative risks with the API change?  In C, enum
and int should be interchangeable, and gcc does not seem to warn against
mixing these types.  Other compilers?  I'm willing to live with new
warning messages (which seems unavoidable) but not hard errors.

2b) For C++?  C++ compilers may warn on code that mixes int and enum,
but the current approach (with functions returning int's that really are
enum's) also leads to C++ warnings, so on balance I think the proposed
change is reasonable as it allows future C++ code to be warning free.

Thanks,
/Simon

[1] http://thread.gmane.org/gmane.comp.gnu.libidn.general/355

Reply via email to