[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Clang compile error
From: |
Lawrence Murray |
Subject: |
Clang compile error |
Date: |
Sat, 17 Nov 2018 09:30:06 +0800 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
Just wanted to report a minor issue that I encountered yesterday after
upgrading to Bison 3.2.1 and Xcode 10.1 on macOS, for which the
corresponding compiler is "Apple LLVM version 10.0.0 (clang-1000.11.45.5)".
I get the following error when compiling C++ code generated from bison:
parser.cpp:1395:8: error: an attribute list cannot appear here
static _Noreturn void
^~~~~~~~~
parser.cpp:231:21: note: expanded from macro '_Noreturn'
# define _Noreturn [[noreturn]]
^~~~~~~~~~~~
I believe the standard syntax is that the attribute should appear before
the "static" keyword, so "_Noreturn static void" instead of "static
_Noreturn void", although other compilers are more forgiving.
A quick fix in the meantime is to add "-D_Noreturn=" to the C++ compiler
flags, as the attribute is not essential.
Cheers,
Lawrence
- Clang compile error,
Lawrence Murray <=