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

[debian-users:38053] Re: woody と sarge の flex/m4 の違い


At Fri, 22 Aug 2003 11:46:22 +0900,
Naotaka YAMAMOTO wrote:
> flex を使っているのですが woody では問題無く通っていたコードが sarge 
> では通らないという現象に当たってしまいました。flex or m4 の問題なのか
> ソース自体を修正すべきなのか分からないので、ご助言頂けますでしょうか。

debian-develに「pitfalls in flex 2.5.xx」という題で、Bastian

I've seen that a lot of release critical errors come from the new
flex 2.5.xx version in unstable.

Here are some of the more common pitfalls:

1) These strings are not allowed in any flex input files, not
   even in comments:  "m4_" "[[" "]]"
   So if you have x[i[j]] in your C code, flex will fail!

   Solution: dont use m4_ prefix and put a space between [[ and ]]
   see flex.info, node "M4 Dependency" for more info

2) yylineno is redefined (eg int yylineno = 0;)
   Solution: Rename this variable to something else, eg mylineno.
   Or use the internal line counting of flex with
   "%options yylineno" and "int lineno() const" for accessing.

3) yytext_ptr is undefined
   You use unput() after the second %% in your lexer file.
   This is not possible anymore due to a bug in flex.
   See http://bugs.debian.org/189332 for more info.

   Solution: move the unput() usage in the rules or header section
   (ie between or above the two %%).
   Or wait until the flex people fix this :)

武藤 健志@Debian/JPプロジェクト   (kmuto@debian.org, kmuto@debian.or.jp)
           株式会社トップスタジオ  (kmuto@xxxxxxxxxxxxxxx)
URI: http://www.topstudio.co.jp/~kmuto/ (Debianな話題など)