Skip to content

Commit 6bb2f15

Browse files
authored
allows const volatile type modifiers (#28)
they were explicitly disabled but I can find any reasons why
1 parent fd12c40 commit 6bb2f15

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

ctoxml/test.t/run.t

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3888,3 +3888,15 @@
38883888
</type>
38893889
</fundec>
38903890
</file>
3891+
3892+
$ echo 'const volatile int n;' | dune exec ctoxml
3893+
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
3894+
<file>
3895+
<var id="n" store="auto">
3896+
<volatile>
3897+
<const>
3898+
<long/>
3899+
</const>
3900+
</volatile>
3901+
</var>
3902+
</file>

frontc/cparser.mly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
| _ -> raise BadModifier in
3939
let check_access typ =
4040
match typ with
41-
PROTO _ | OLD_PROTO _ | CONST _ | VOLATILE _ -> false
41+
PROTO _ | OLD_PROTO _ -> false
4242
| _ -> true in
4343
match modi with
4444
BASE_SIGN _ -> (mod_root typ, sto)

0 commit comments

Comments
 (0)