[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: avoid c++ failure due to lack of getenv decl
From: |
Akim Demaille |
Subject: |
Re: [PATCH] tests: avoid c++ failure due to lack of getenv decl |
Date: |
Thu, 16 Feb 2012 12:10:10 +0100 |
Le 16 févr. 2012 à 11:11, Jim Meyering a écrit :
> I noticed that there was a single test failure when
> running "make check" using the latest gcc/g++ from git (4.7.x).
>
> Pushed to master, as obvious:
Thanks!
> %code
> {
> + #include <stdlib.h>
FWIW, the proper way to include standard C headers
in C++ is without .h, and a prepended "c". So that would be
#include <cstdlib>.
> int yylex (yy::parser::semantic_type *);
> }
>
> @@ -510,7 +511,7 @@ yy::parser::error (const std::string &m)
> }
>
> int
> -main ()
> +main (void)
C++ forbids functions which are not prototyped, so
void is useless here, and () cannot mean "I did not
specify the argument types". So it's rather more
common not to use void for incoming arguments than
specifying it.