From 39027a6ea0446b45d2c8aee1eb0c256a6f0f7417 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 7 Jul 2013 08:41:55 +0000 Subject: Bad printing of alignment on 'comm' symbols. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2291 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- cfrontend/CPragmas.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cfrontend') diff --git a/cfrontend/CPragmas.ml b/cfrontend/CPragmas.ml index 5ae147e..a31378e 100644 --- a/cfrontend/CPragmas.ml +++ b/cfrontend/CPragmas.ml @@ -37,9 +37,13 @@ let process_section_pragma classname istring ustring addrmode accmode = (* #pragma use_section *) +let re_c_ident = Str.regexp "[A-Za-z_][A-Za-z_0-9]*$" + let process_use_section_pragma classname id = - if not (Sections.use_section_for (intern_string id) classname) - then C2C.error (sprintf "unknown section name `%s'" classname) + if not (Str.string_match re_c_ident id 0) then + C2C.error (sprintf "bad identifier `%s' in #pragma use_section" id); + if not (Sections.use_section_for (intern_string id) classname) then + C2C.error (sprintf "unknown section name `%s'" classname) (* #pragma reserve_register *) -- cgit v1.2.3