Skip to content

Commit

Permalink
i18n: avoid parenthesized string as array initializer
Browse files Browse the repository at this point in the history
The syntax

    static const char ignore_error[] = ("something");

is invalid C.  A parenthesized string is not allowed as an array
initializer.

Some compilers, for example GCC and MSVC, allow this syntax as an
extension, but it is not a portable construct.  tcc does not parse it, for
example.

Remove the parenthesis from the definition of the N_() macro to
fix this.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramsay Jones authored and Junio C Hamano committed Apr 11, 2011
1 parent e3fa246 commit 642f85f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gettext.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ const char *Q_(const char *msgid, const char *plu, unsigned long n)
}

/* Mark msgid for translation but do not translate it. */
#define N_(msgid) (msgid)
#define N_(msgid) msgid

#endif

0 comments on commit 642f85f

Please sign in to comment.