GNU gettext - Bugs: bug #43970, Incorrect "warning:...
You are not allowed to post comments on this tracker with your current authentication level.
bug #43970: Incorrect "warning: unterminated string literal" for some C++11 raw strings
Submitter: | Vaclav Slavik <vslavik> | ||
Submitted: | Sat 10 Jan 2015 02:27:48 PM UTC | ||
Category: | C | Severity: | 3 - Normal |
Item Group: | None | Status: | Fix Released |
Privacy: | Public | Assigned to: | ueno |
Open/Closed: | Closed |
Tue 13 Jan 2015 03:17:03 AM UTC, comment #5: |
Daiki Ueno <ueno> |
Mon 12 Jan 2015 10:29:46 AM UTC, comment #4: I see, this didn't occur to me (nor the fact that C++11 compiler won't compile this until now). Wouldn't it be better, then, to (if necessary) start making a distinction between C and C++ modes, instead of introducing a new C++11 one? IMHO the example you gave is quite artificial and very unlikely to occur in practice, but I get your point. It is even less likely to occur in C++, though, because of the C++ culture that really frowns upon such macro uses. Plus C++ compilers will eventually switch to having C++11/4/7 as the default (some already did, although not gcc) and such code would have to be updated anyway, making the chance of it occurring ever smaller.
|
Vaclav Slavik <vslavik> |
Sun 11 Jan 2015 10:43:28 PM UTC, comment #3: Consider the following code:
|
Daiki Ueno <ueno> |
Sun 11 Jan 2015 05:39:46 PM UTC, comment #2:
|
Vaclav Slavik <vslavik> |
Sun 11 Jan 2015 08:31:20 AM UTC, comment #1: Thanks for the report. Yes, there are a couple of problems in the raw string scanner: determining the end of a raw string, and handling escape sequences differently from ordinary strings.
|
Daiki Ueno <ueno> |
Sat 10 Jan 2015 02:27:48 PM UTC, original submission:
I'm filing this bug even though there's #43726 (closed as duplicate), because I can't figure out how to reopen the bug.
|
Vaclav Slavik <vslavik> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 7 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2023-01-04 | haible | Status | Fixed | Fix Released | |
2016-11-27 | haible | Category | None | C | |
2015-01-13 | ueno | Status | Confirmed | Fixed | |
Open/Closed | Open | Closed | |||
2015-01-11 | ueno | Attached File | - | Added 0001-c-Make-C-11-raw-string-recognition-stricter.patch, #32804 | |
Status | None | Confirmed | |||
Assigned to | None | ueno |
Powered by Savane 3.13-caa5.
Corresponding source code
Thanks, that sounds a reasonable solution (given that the C standard is unlikely to incorporate raw string literals in near future).
I've pushed a couple of patches along these lines:
http://git.savannah.gnu.org/cgit/gettext.git/commit/?id=4dfe1c4609a5c600112cd83a4d3af5d4e4d402c7
http://git.savannah.gnu.org/cgit/gettext.git/commit/?id=383b5ba48b20bc6583ee63f13741dd84e96c5002