The file usr.bin/bc/scan.l includes <termios.h>. This header file defines a macro named ECHO. But lex generates code which also defines a macro named ECHO. For some reason, lex only defines ECHO if ECHO is not already defined.
bc(1) builds fine, but the ECHO macro used in lexer code is the one from <termios.h>, which is wrong. Moving #include <termios.h> below the lex code, after an #undef ECHO fix the issue, but it might be better to move the gettty/settty/tspcons functions in a separated file. Also, while you are here, there is no forward declaration of struct termios in file "extern.h", modern gcc are not happy with that. best regards, joris
