bug-bison
[Top][All Lists]
Advanced

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

bison-2.1 compilation warnings


From: Bruno Haible
Subject: bison-2.1 compilation warnings
Date: Wed, 10 May 2006 22:00:36 +0200
User-agent: KMail/1.5

Hi,

Compiling bison-2.1 on Linux/x86 with SunPRO C 5.9, yields the following
warnings:

/opt/sun/compilers-20060314/bin/CC -DHAVE_CONFIG_H -I. -I. -I../..     -xO5 -c 
-o calc++-scanner.o calc++-scanner.cc
"calc++-scanner.cc", line 986: Warning: Too few arguments in macro yywrap.
"calc++-scanner.cc", line 1309: Warning: Too few arguments in macro yywrap.
2 Warning(s) detected.

calc++-scanner.cc contains at line 389:

============================
/* Begin user sect3 */

#define yywrap(n) 1
#define YY_SKIP_YYWRAP
============================

and at line 566:

============================
/* Macros after this point can all be overridden by user definitions in
 * section 1.
 */

#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap (void );
#else
extern int yywrap (void );
#endif
#endif
============================

and at line 980:

============================
                else switch ( yy_get_next_buffer(  ) )
                        {
                        case EOB_ACT_END_OF_FILE:
                                {
                                (yy_did_buffer_switch_on_eof) = 0;

                                if ( yywrap( ) )
                                        {
                                        /* Note: because we've taken care in
                                         * yy_get_next_buffer() to have set up
                                         * yytext, we can now set up
                                         * yy_c_buf_p so that if some total
                                         * hoser (like flex itself) wants to
                                         * call the scanner after we return the
                                         * YY_NULL, it'll still work - another
                                         * YY_NULL will get returned.
                                         */
                                        (yy_c_buf_p) = (yytext_ptr) + 
YY_MORE_ADJ;

                                        yy_act = YY_STATE_EOF(YY_START);
                                        goto do_action;
                                        }

                                else
                                        {
                                        if ( ! (yy_did_buffer_switch_on_eof) )
                                                YY_NEW_FILE;
                                        }
                                break;
                                }
============================

and at line 1307:

============================
                                case EOB_ACT_END_OF_FILE:
                                        {
                                        if ( yywrap( ) )
                                                return EOF;

                                        if ( ! (yy_did_buffer_switch_on_eof) )
                                                YY_NEW_FILE;
#ifdef __cplusplus
                                        return yyinput();
#else
                                        return input();
#endif
                                        }
============================

I think it's actually not valid C to invoke a macro without arguments that
is defined as a macro with 1 argument.

The same warning appears in packages containing a Bison parser too, for example
in source-highlight-1.11:
"perl_scanner.cc", line 1947: Warning: Too few arguments in macro 
perl_scanner_wrap.
"perl_scanner.cc", line 2241: Warning: Too few arguments in macro 
perl_scanner_wrap.

Bruno





reply via email to

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