Send inn-workers mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/inn-workers
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of inn-workers digest..."


Today's Topics:

   1. Re: Building INN with flex 2.5.36 (Julien ?LIE)


----------------------------------------------------------------------

Message: 1
Date: Tue, 30 Jul 2013 20:31:34 +0200
From: Julien ?LIE <[email protected]>
To: [email protected]
Subject: Re: Building INN with flex 2.5.36
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252

Hi all,

> What would be the best way to fix the issue? I see that someone added
> an autoconf test (defining YYLENG_IS_YY_SIZE_T) to check the type of
> yyleng: 
> https://github.com/bgilbert/nip2/commit/5b135dd968633ecee11a9aec8b35df5862f58683
>
>  Should a similar fix be used in INN or do you see another solution?

I believe the most straight-forward fix is to remove the redefinition of 
prototypes
(recent versions of flex do not trigger missing prototype warnings), and to
always cast the return value of yyget_leng() to size_t.


--- configfile.l        (r?vision 9510)
+++ configfile.l        (copie de travail)
@@ -31,20 +31,6 @@
    warnings about it. */
 static void yyunput(int, char *) UNUSED;
 
-/* Prototype the various accessor functions generated by flex to avoid
-   missing prototype warnings. */
-int yyget_lineno(void);
-FILE *yyget_in(void);
-FILE *yyget_out(void);
-int yyget_leng(void);
-char *yyget_text(void);
-int yyget_debug(void);
-void yyset_lineno(int);
-void yyset_in(FILE *);
-void yyset_out(FILE *);
-void yyset_debug(int);
-int yylex_destroy(void);
-
 char *strPtr = 0 ;
 int strPtrLen = 0 ;
 int strIdx = 0 ;
@@ -52,7 +38,6 @@
 int lineCount = 0 ;
 int current ;
 
-static void strAppend (int ch);
 static void strAppend (int ch)
 {
   if (strIdx == strPtrLen)
@@ -162,11 +147,13 @@
                          return (CHAR) ;}
 
 \"[^\"]*       {{
-       int i ;
+       size_t i ;
 
        for (i = 1, strIdx = 0, sawBsl = 0 ; ; i++)
           {
-            if (i < yyleng)
+            /* Cast yyget_leng() to size_t because it used to be an int
+             * in flex versions anterior to 2.5.35 (not included). */
+            if (i < (size_t) yyget_leng())
               current = yytext [i] ;
             else
               current = input() ;





-- 
Julien ?LIE

? ? Je t'ai pr?par? une bonne soupe dont tu me diras des
    nouvelles, mon gar?on !
  ? Pour moi, ?a, ce n'est pas des bonnes nouvelles ! ? (Ast?rix)


------------------------------

_______________________________________________
inn-workers mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/inn-workers

End of inn-workers Digest, Vol 53, Issue 6
******************************************

Reply via email to