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:  C Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned 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
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by cuavas (Updated the item)
  • -email is unavailable- added by mbunkus (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can 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
    2018-01-06 haible StatusNone => Fixed
        Assigned toNone => haible
        Open/ClosedOpen => Closed
    2017-07-28 cuavas Attached File- => Added 0001-Recognise-C-14-digit-grouping-with-character.patch, #41365

    Back to the top


    Powered by Savane 3.3