bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug#547798: [gettext]: gettext.h incompatible with g++ -pedantic (error:


From: Santiago Vila
Subject: Bug#547798: [gettext]: gettext.h incompatible with g++ -pedantic (error: ISO C++ forbids variable length array ‘msg _ctxt_id’) (fwd)
Date: Tue, 22 Sep 2009 12:13:38 +0200 (CEST)

Hello.

I received this from the Debian bug system:

---------- Forwarded message ----------
From: Jens Seidel <address@hidden>
To: address@hidden
Date: Tue, 22 Sep 2009 11:20:39 +0200
Subject: Bug#547798: [gettext]: gettext.h incompatible with g++ -pedantic
    (error: ISO C++ forbids variable length array [UTF-8] msg_ctxt_id)

Package: gettext
Version: 0.17-7
Severity: important

Hi,

compiling
#include "/usr/share/gettext/gettext.h"

int main()
{
  return 0;
}
with g++ -pedantic results in:

/usr/share/gettext/gettext.h: In function ÿÿconst char* dcpgettext_expr(const
char*, const char*, const char*, int)ÿÿ:
/usr/share/gettext/gettext.h:201: error: ISO C++ forbids variable length
array ÿÿmsg_ctxt_idÿÿ
/usr/share/gettext/gettext.h: In function ÿÿconst char*
dcnpgettext_expr(const char*, const char*, const char*, const char*, long
unsigned int, int)ÿÿ:
/usr/share/gettext/gettext.h:247: error: ISO C++ forbids variable length
array ÿÿmsg_ctxt_idÿÿ

I work around it by using

 #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
-  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
+  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) && !__cplusplus \

but detecting a macro which is set in pedantic mode is probably better.

Jens




reply via email to

[Prev in Thread] Current Thread [Next in Thread]