bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bison'd files don't compile under Microsoft VC++


From: Akim Demaille
Subject: Re: bison'd files don't compile under Microsoft VC++
Date: Wed, 13 Feb 2002 19:47:00 +0100
User-agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Common Lisp, i386-debian-linux)

| One of the 'features' of the Microsoft environment is that size_t isn't in
| the std:: namespace.
| malloc and free didn't make it either.
| The versions of bison.simple in Bison 1.3.1 and Bison 1.3.3 won't work with
| Microsoft.

I was sure this would happen.  Sigh.

| Enclosed a patch for 1.3.3, and a testcase.
| 
| Dave Gluss
| 
| 
| 
| *** /usr/share/bison/133/bison.simple Tue Feb 12 09:05:39 2002
| --- /usr/share/bison/bison.simple     Tue Feb 12 09:39:45 2002
| ***************
| *** 67,81 ****
|   # else
|   #  ifdef __cplusplus
|   #   include <cstdlib> /* INFRINGES ON USER NAME SPACE */
| ! #   define YYSIZE_T std::size_t
|   #  else
|   #   ifdef __STDC__
|   #    include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|   #    define YYSIZE_T size_t
|   #   endif
|   #  endif
| ! #  define YYSTACK_ALLOC YYSTD (malloc)
| ! #  define YYSTACK_FREE YYSTD (free)
|   # endif
|   
|   /* A type that is properly aligned for any stack member.  */
| --- 67,90 ----
|   # else
|   #  ifdef __cplusplus
|   #   include <cstdlib> /* INFRINGES ON USER NAME SPACE */
| ! #   if _WIN32
| ! #    define YYSIZE_T size_t
| ! #   else
| ! #    define YYSIZE_T std::size_t
| ! #   endif
|   #  else
|   #   ifdef __STDC__
|   #    include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|   #    define YYSIZE_T size_t
|   #   endif
|   #  endif
| ! #  ifdef _WIN32
| ! #   define YYSTACK_ALLOC malloc
| ! #   define YYSTACK_FREE  free
| ! #  else
| ! #   define YYSTACK_ALLOC YYSTD (malloc)
| ! #   define YYSTACK_FREE YYSTD (free)
| ! #  endif
|   # endif
|   
|   /* A type that is properly aligned for any stack member.  */
| ***************
| *** 132,138 ****
|   #if ! defined (YYSIZE_T)
|   # ifdef __cplusplus
|   #  include <cstddef> /* INFRINGES ON USER NAME SPACE */
| ! #  define YYSIZE_T std::size_t
|   # else
|   #  ifdef __STDC__
|   #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
| --- 141,151 ----
|   #if ! defined (YYSIZE_T)
|   # ifdef __cplusplus
|   #  include <cstddef> /* INFRINGES ON USER NAME SPACE */
| ! #  if _WIN32
| ! #   define YYSIZE_T size_t
| ! #  else
| ! #   define YYSIZE_T std::size_t
| ! #  endif
|   # else
|   #  ifdef __STDC__
|   #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */


Nah, I don't want to walk that tracks...

Well, may I ask you what would happen had Bison output some real C++?
Would you switch to that environment, or would you still use the C
parsers compiled with a C++ compiler?

I think we went too far in our attempt to please C++ compilers.
Bison.simple is definitely meant for C.

Opinions?  Paul?  I hope to be able to release Bison 1.50 with C++
some time in the next two months, but...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]