]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add strftime format checking support for C2x %OB and %Ob (bug 82752).
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Oct 2019 21:56:14 +0000 (21:56 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Oct 2019 21:56:14 +0000 (21:56 +0000)
commit95384b9ea86ff301df480619f6c00b7460bebcda
treeea451e764d55e6941bf945e7254076fc1e531b97
parent1c3ff0924f0ab8c8fc37788e4021c978f0d27b4d
Add strftime format checking support for C2x %OB and %Ob (bug 82752).

C2x adds strftime %OB and %Ob formats, for alternative forms of month
names (for mainly Slavic languages where a month name on its own is
declined differently from a month name together with a date within
that month).  This patch adds corresponding format checking support.
(glibc support for these formats was added in glibc 2.27.)

Bootstrapped with no regressions on x86_64-pc-linux-gnu.

PR c/82752
gcc/c-family:
* c-format.c (C_STD_VER): Handle C2x.
(C_STD_NAME): Likewise.
(strftime_flag_specs): Add 'O' modifier with 'p' flag.
(time_char_table): Use separate entry for 'B' and 'b', with 'O'
modifier allowed and 'p' flag.
* c-format.h (enum format_std_version): Add STD_C2X.
(struct format_char_info): Mention 'p' in comment on flags2.

gcc/testsuite:
* gcc.dg/format/c2x-strftime-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@276605 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/c-family/ChangeLog
gcc/c-family/c-format.c
gcc/c-family/c-format.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/format/c2x-strftime-1.c [new file with mode: 0644]