bugGNU gettext - Bugs: bug #50117, bogus "unterminated character...


You are not allowed to post comments on this tracker with your current authentication level.

bug #50117: bogus "unterminated character constant" warning with C++14 single-quotation-mark as digit separators

Submitted by:  Moritz Bunkus <mbunkus>
Submitted on:  Sun 22 Jan 2017 11:03:34 AM UTC  
Category: CSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

Sat 06 Jan 2018 05:52:21 PM UTC, comment #2:

Thanks for the report. Fixed through http://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=6d86e6f80d60c414888ba54eb313f897776cecf1

I could not use your patch, because the code was hard to understand (two additional booleans in a loop) and not standards-compliant (no support for the '_' character in preprocessing number tokens).

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Fri 28 Jul 2017 01:45:48 AM UTC, comment #1:

I've created a patch to support this, and tested it on MAME, which makes fairly heavy use of C++14 digit grouping. I'm attaching it as a git changeset.

(file #41365)

Vas Crabb <cuavas>
Sun 22 Jan 2017 11:03:34 AM UTC, original submission:

xgettext doesn't support C++14's "Single-quotation-mark as a digit separator" feature[1] properly. It'll issue a warning about an "unterminated character constant" with the following trivial program:

int main() {
auto i = 1'234;
return 0;

Invoke xgettext:

[0 mosu@sweet-chili ~/test] xgettext -o test.pot test2.cpp
test2.cpp:2: warning: unterminated character constant

If you want to verify that this is an actually valid C++14 program:

[0 mosu@sweet-chili ~/test] g++ -std=c++14 -o test2 test2.cpp
[0 mosu@sweet-chili ~/test]

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf

Moritz Bunkus <mbunkus>


Attached Files


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by haible (Posted a comment)
  • -unavailable- added by cuavas (Updated the item)
  • -unavailable- added by mbunkus (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 06 Jan 2018 05:52:21 PM UTChaibleStatusNone=>Fixed
      Assigned toNone=>haible
    Fri 28 Jul 2017 01:45:48 AM UTCcuavasAttached File-=>Added 0001-Recognise-C-14-digit-grouping-with-character.patch, #41365

    Back to the top

    Powered by Savane 3.1-cleanup1