From: Nick Bowler Date: Sun, 7 Jan 2024 14:54:31 +0000 (-0500) Subject: libcdecl: Remove unused YY_INPUT from scanner. X-Git-Tag: v1.3~43 X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/d349b9bb3fde8fc1d1222d5b7ac8dbbaf6dee230 libcdecl: Remove unused YY_INPUT from scanner. We only scan strings so the code that uses YY_INPUT is never actually executed, but it still takes space in the library and creates symbol references to various file I/O functions that have to be resolved at runtime. We can provide a stub YY_INPUT to suppress all of this. --- diff --git a/lib/local/modules/dx-nls b/lib/local/modules/dx-nls index b150d30..9a1a6fb 100644 --- a/lib/local/modules/dx-nls +++ b/lib/local/modules/dx-nls @@ -1,5 +1,5 @@ Description: -blargh +Conditionally pull in various gnulib modules for NLS support. Files: diff --git a/src/scan.l b/src/scan.l index 48314d4..bd1c5c5 100644 --- a/src/scan.l +++ b/src/scan.l @@ -1,7 +1,7 @@ %top{ /* * Scanner for C declarations. - * Copyright © 2011, 2021, 2023 Nick Bowler + * Copyright © 2011, 2021, 2023-2024 Nick Bowler * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,8 @@ #include #include "parse.h" +/* Disable various generated code we don't use */ +#define YY_INPUT(a, b, c) do {} while (0) #define YY_NO_INPUT 1 #define YY_NO_UNPUT 1 }