> Le 27 nov. 2014 à 09:39, Nicolas Bedon <nicolas.be...@univ-rouen.fr> a écrit :
> 
> Hi,
> 
> It seems to me that the default main in the Yacc library (gcc option -ly) for 
> bison fixes the locale for its execution according to the configuration of 
> the host, whereas the default main generated by bison (no -ly gcc option) 
> does not. This difference of behaviours should be documented somewhere in the 
> bison manual. I suggest to add, in the documentation, a description of both 
> default main functions.

Hi!

I have installed the following change in the "maint" branch.
Thanks!

commit 9a91e7f24626da71bb4b5f0bd76159f34ba2b6f6
Author: Akim Demaille <a...@lrde.epita.fr>
Date:   Mon Jan 12 11:34:42 2015 +0100

    doc: liby's main arms the internationalization
    
    Reported by Nicolas Bedon.
    <https://lists.gnu.org/archive/html/bug-bison/2014-11/msg00005.html>
    
    * doc/bison.texi (Yacc Library): Document the call the setlocale.

diff --git a/THANKS b/THANKS
index 4fc9984..b984910 100644
--- a/THANKS
+++ b/THANKS
@@ -95,6 +95,7 @@ Mike Sullivan             mike.sulli...@oracle.com
 Neil Booth                ne...@earthling.net
 Nelson H. F. Beebe        be...@math.utah.edu
 Nick Bowler               nbow...@elliptictech.com
+Nicolas Bedon             nicolas.be...@univ-rouen.fr
 Nicolas Burrus            nicolas.bur...@epita.fr
 Nicolas Tisserand         nicolas.tisser...@epita.fr
 Noah Friedman             fried...@gnu.org
diff --git a/doc/bison.texi b/doc/bison.texi
index d402215..1a2b169 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -10382,9 +10382,23 @@ declare @code{yyerror} as follows:
 int yyerror (char const *);
 @end example
 
-Bison ignores the @code{int} value returned by this @code{yyerror}.
-If you use the Yacc library's @code{main} function, your
-@code{yyparse} function should have the following type signature:
+@noindent
+The @code{int} value returned by this @code{yyerror} is ignored.
+
+The implementation of Yacc library's @code{main} function is:
+
+@example
+int main (void)
+@{
+  setlocale (LC_ALL, "");
+  return yyparse ();
+@}
+@end example
+
+@noindent
+so if you use it, the internationalization support is enabled (e.g., error
+messages are translated), and your @code{yyparse} function should have the
+following type signature:
 
 @example
 int yyparse (void);


Reply via email to