public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/55678] New: _Static_assert escapes tick marks just to make me mad
@ 2012-12-13 21:08 daniel.santos at pobox dot com
  2012-12-13 21:12 ` [Bug c/55678] " daniel.santos at pobox dot com
  0 siblings, 1 reply; 2+ messages in thread
From: daniel.santos at pobox dot com @ 2012-12-13 21:08 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55678

             Bug #: 55678
           Summary: _Static_assert escapes tick marks just to make me mad
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.santos@pobox.com


#define BUILD_BUG_ON(cond) _Static_assert(!(cond), #cond)
void f() {
    const int a='4';
    BUILD_BUG_ON(a == '4');
    _Static_assert(0, "don't call static assert with zero, silly!");
}

test.c: In function ‘f’:
test.c:4:2: error: static assertion failed: "a == \'4\'"
test.c:5:2: error: static assertion failed: "don\'t call static assert with
zero, silly!"

I found nothing in the standard that says to do escape any character, only
§6.7.10 (of C11) that says you can choose to not print a character that's not
in the basic source character set, but the single-quote/tick-mark is.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/55678] _Static_assert escapes tick marks just to make me mad
  2012-12-13 21:08 [Bug c/55678] New: _Static_assert escapes tick marks just to make me mad daniel.santos at pobox dot com
@ 2012-12-13 21:12 ` daniel.santos at pobox dot com
  0 siblings, 0 replies; 2+ messages in thread
From: daniel.santos at pobox dot com @ 2012-12-13 21:12 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55678

--- Comment #1 from Daniel Santos <daniel.santos at pobox dot com> 2012-12-13 21:12:24 UTC ---
This appears to happen in the function
c_parser_static_assert_declaration_no_semi (gcc/c/c-parser.c) when it calls
"c_parser_peek_token (parser)->value", but I don't know gcc's internals very
well and would rather not lie to you.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-13 21:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-13 21:08 [Bug c/55678] New: _Static_assert escapes tick marks just to make me mad daniel.santos at pobox dot com
2012-12-13 21:12 ` [Bug c/55678] " daniel.santos at pobox dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).