Skip to content

Commit 332665a

Browse files
authored
Merge pull request #6616 from certik/volatile_warning
Add a warning that volatile attribute is not supported yet
2 parents 45ea32f + 11d549f commit 332665a

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RUN bash Miniforge3-$(uname)-$(uname -m).sh -b
1111

1212
RUN /root/miniforge3/bin/mamba init bash
1313

14-
WORKDIR /lfortran
14+
WORKDIR /lfortran_build
1515

1616
COPY . .
1717

@@ -29,4 +29,4 @@ FROM ubuntu:22.04 AS app
2929
RUN apt update
3030
RUN apt install binutils clang --no-install-recommends -y
3131

32-
COPY --from=build /lfortran/inst /app
32+
COPY --from=build /lfortran_build/inst /app

src/lfortran/semantics/ast_common_visitor.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3373,6 +3373,11 @@ class CommonVisitor : public AST::BaseVisitor<Derived> {
33733373
::AttrNoPass) {
33743374
} else if (sa->m_attr == AST::simple_attributeType::AttrVolatile) {
33753375
// TODO: Implement volatile attribute
3376+
diag.add(Diagnostic(
3377+
"The volatile attribute is not implemented yet (https://github.com/lfortran/lfortran/issues/6555), ignoring for now",
3378+
Level::Warning, Stage::Semantic, {
3379+
Label("",{sa->base.base.loc})
3380+
}));
33763381
} else {
33773382
diag.add(Diagnostic(
33783383
"Attribute type not implemented yet " + std::to_string(sa->m_attr),

tests/errors/continue_compilation_1.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ program continue_compilation_1
6868
integer, parameter :: zero = 0
6969
integer :: x = 1
7070
real :: adwf = .true.
71-
71+
integer, volatile :: volatile_var
7272

7373

7474

tests/reference/asr-continue_compilation_1-04b6d40.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"basename": "asr-continue_compilation_1-04b6d40",
33
"cmd": "lfortran --semantics-only --continue-compilation --no-color {infile}",
44
"infile": "tests/errors/continue_compilation_1.f90",
5-
"infile_hash": "f61ceeb18d5c0691a20bb0c80b78a2dd5737ee3a1f6c6767593d45b4",
5+
"infile_hash": "b0a44f6ea3539170c3a63a3091ed8c7ed50db83056d8124c17a17330",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": null,
99
"stdout_hash": null,
1010
"stderr": "asr-continue_compilation_1-04b6d40.stderr",
11-
"stderr_hash": "46d28064e27ef07141fb6aa7ff96f7fd6194a8e134bde0eeef71f8a3",
11+
"stderr_hash": "1e77cc565426f0ab9944ce60e24316e72b0beb2b16344b6f83eb0f8d",
1212
"returncode": 1
1313
}

tests/reference/asr-continue_compilation_1-04b6d40.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ semantic error: Cannot convert LOGICAL to REAL
2020
70 | real :: adwf = .true.
2121
| ^^^^^^
2222

23+
warning: The volatile attribute is not implemented yet (https://github.com/lfortran/lfortran/issues/6555), ignoring for now
24+
--> tests/errors/continue_compilation_1.f90:71:14
25+
|
26+
71 | integer, volatile :: volatile_var
27+
| ^^^^^^^^
28+
2329
semantic error: Assignment to loop variable `i` is not allowed
2430
--> tests/errors/continue_compilation_1.f90:114:8
2531
|

0 commit comments

Comments
 (0)