You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write code that is as compliant as possible. That's why I
always compile with -ansi and -pedantic.
But the attached program won't compile. Since LOG works as expected I'm
rather confused that it does not work with VLOG.
What steps will reproduce the problem?
1. Try compiling the attached program
I used
g++ -ansi -Wno-long-long -pedantic -I<path to glog include> -L<path to glog
lib> -lglog vlog.cc
What is the expected output? What do you see instead?
It should compile it. Bit instead you get the error
vlog.cc:11: error: ISO C++ forbids braced-groups within expressions
from g++.
What version of the product are you using? On what operating system?
I'm using version 0.3.0 on Debian Linux.
$ g++ --version
g++ (Debian 4.3.2-1.1) 4.3.2
As a workaround one can remove -pedantic.
Regards
Original issue reported on code.google.com by jens.k.mueller@gmail.com on 22 Jan 2010 at 11:05
The macro VLOG* uses the macro VLOG_IS_ON which has a braced-group within
expression
(http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gcc/Statement-Exprs.html#Statement-Expr
s). I
I don't know whether it is possible to write this macro without braced-group.
That
would fix the problem. At the moment instead of not using -pedantic one can do
__extension__ VLOG_IF(10, (0 == 1))
<< "test";
to disable pedantic warnings for the following expression.
I haven't found a gcc option to disable those warnings in general.
Original comment by jens.k.mueller@gmail.com on 25 Mar 2010 at 12:54
Original issue reported on code.google.com by
jens.k.mueller@gmail.com
on 22 Jan 2010 at 11:05Attachments:
The text was updated successfully, but these errors were encountered: