* Comment on web page https://gcc.gnu.org/projects/cxx-status.html#cxx11
@ 2021-12-03 18:58 Dr. Jürgen Sauermann
2021-12-03 20:12 ` Jonathan Wakely
0 siblings, 1 reply; 3+ messages in thread
From: Dr. Jürgen Sauermann @ 2021-12-03 18:58 UTC (permalink / raw)
To: gcc
Hi,
not sure if this matters or how int can be fixed, but today I observed
the following:
Your web page says that "Static assertions" are supported by GCC since
version 4.3.
Today I tried to use "Static assertions" on an avr-g++ resp. avr-gcc
which identifies
itself as:
eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ avr-g++ --version
avr-g++ (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ avr-gcc --version
avr-gcc (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
but it seems not to support static assertions.
The "regular" g++ works:
eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ echo '
static_assert(0, "error"); int main() {}' | g++ -S -o /dev/null -x c++ -
<stdin>:2:15: error: static assertion failed: error
while the avr-g++ fails:
eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ echo '
static_assert(0, "error"); int main() {}' | avr-g++ -S -o /dev/null -x c++ -
<stdin>:2:14: error: expected constructor, destructor, or type
conversion before ‘(’ token
Maybe this should be mentioned on the web page.
Best Regards,
Jürgen Sauermann
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Comment on web page https://gcc.gnu.org/projects/cxx-status.html#cxx11
2021-12-03 18:58 Comment on web page https://gcc.gnu.org/projects/cxx-status.html#cxx11 Dr. Jürgen Sauermann
@ 2021-12-03 20:12 ` Jonathan Wakely
2021-12-04 10:32 ` Dr. Jürgen Sauermann
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2021-12-03 20:12 UTC (permalink / raw)
To: Dr. Jürgen Sauermann; +Cc: gcc
On Fri, 3 Dec 2021, 18:58 Dr. Jürgen Sauermann, <mail@juergen-sauermann.de>
wrote:
> Hi,
>
> not sure if this matters or how int can be fixed, but today I observed
> the following:
>
> Your web page says that "Static assertions" are supported by GCC since
> version 4.3.
>
> Today I tried to use "Static assertions" on an avr-g++ resp. avr-gcc
> which identifies
> itself as:
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ avr-g++ --version
> avr-g++ (GCC) 5.4.0
> Copyright (C) 2015 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ avr-gcc --version
> avr-gcc (GCC) 5.4.0
> Copyright (C) 2015 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> but it seems not to support static assertions.
>
> The "regular" g++ works:
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ echo '
> static_assert(0, "error"); int main() {}' | g++ -S -o /dev/null -x c++ -
> <stdin>:2:15: error: static assertion failed: error
>
> while the avr-g++ fails:
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ echo '
> static_assert(0, "error"); int main() {}' | avr-g++ -S -o /dev/null -x c++
> -
> <stdin>:2:14: error: expected constructor, destructor, or type
> conversion before ‘(’ token
>
> Maybe this should be mentioned on the web page.
>
Static assertions are a C++11 feature, so you simply need to use -std=c++11
or -std=gnu++11
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Comment on web page https://gcc.gnu.org/projects/cxx-status.html#cxx11
2021-12-03 20:12 ` Jonathan Wakely
@ 2021-12-04 10:32 ` Dr. Jürgen Sauermann
0 siblings, 0 replies; 3+ messages in thread
From: Dr. Jürgen Sauermann @ 2021-12-04 10:32 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: gcc
On 12/3/21 9:12 PM, Jonathan Wakely wrote:
>
>
> On Fri, 3 Dec 2021, 18:58 Dr. Jürgen Sauermann,
> <mail@juergen-sauermann.de <mailto:mail@juergen-sauermann.de>> wrote:
>
> Hi,
>
> not sure if this matters or how int can be fixed, but today I
> observed
> the following:
>
> Your web page says that "Static assertions" are supported by GCC
> since
> version 4.3.
>
> Today I tried to use "Static assertions" on an avr-g++ resp. avr-gcc
> which identifies
> itself as:
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ avr-g++
> --version
> avr-g++ (GCC) 5.4.0
> Copyright (C) 2015 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ avr-gcc
> --version
> avr-gcc (GCC) 5.4.0
> Copyright (C) 2015 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
>
> but it seems not to support static assertions.
>
> The "regular" g++ works:
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ echo '
> static_assert(0, "error"); int main() {}' | g++ -S -o /dev/null -x
> c++ -
> <stdin>:2:15: error: static assertion failed: error
>
> while the avr-g++ fails:
>
> eedjsa@server68:~/projects/AVR_workspace/ATMEGA8U2_32U2$ echo '
> static_assert(0, "error"); int main() {}' | avr-g++ -S -o
> /dev/null -x c++ -
> <stdin>:2:14: error: expected constructor, destructor, or type
> conversion before ‘(’ token
>
> Maybe this should be mentioned on the web page.
>
>
>
> Static assertions are a C++11 feature, so you simply need to use
> -std=c++11 or -std=gnu++11
>
>
Hi Jonathan,
thanks a lot. This works indeed, even with avr-gcc/g++.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-04 10:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 18:58 Comment on web page https://gcc.gnu.org/projects/cxx-status.html#cxx11 Dr. Jürgen Sauermann
2021-12-03 20:12 ` Jonathan Wakely
2021-12-04 10:32 ` Dr. Jürgen Sauermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).