[Top][All Lists]

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

implicit declaration of function 'yylex' is invalid in C99

From: Ryan Schmidt
Subject: implicit declaration of function 'yylex' is invalid in C99
Date: Fri, 14 Jan 2022 03:52:24 -0600


On macOS 10.15 or later with bison 3.8.2, flex 2.6.4, and Xcode 12 or later, 
when software is built that uses bison/flex, I often see this type of failure:

error: implicit declaration of function 'yylex' is invalid in C99 
      yychar = YYLEX;
note: expanded from macro 'YYLEX'
# define YYLEX yylex ()

As of Xcode 12, implicit declaration of function is an error. You must provide 
a function prototype before you call a function.

A quick search shows many people encountering this problem:


It sounds very much like the problem reported to this mailing list in 2005:


A fix was proposed there as well. Does anyone know if that proposal was ever 
accepted? It's difficult for me to determine because I'm not familiar with the 
bison source code and it has probably evolved significantly since 2005.

I don't know much about bison and flex. If this is actually a flex bug let me 
know and I can report it over there.

reply via email to

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