config_file.l: Change default prefix for global symbols.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 11 Jul 2017 19:41:47 +0000 (21:41 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 28 Nov 2017 09:54:24 +0000 (10:54 +0100)
Without this, applications which use flex for their own work might run
into problems due to duplicate symbols when linking against liblopsub.
Since this is an ABI change, we have to increment the ABI version
number.

No changes in the source code are necessary since flex provides macros
which allow to still refer to the variables and functions with the
usual yy prefixed names. However, the command

nm -e liblopsub.a

shows that the external symbols are now prefixed with lls_yy.

Note that the patch only changes config_file.l. We don't bother to
adjust lopsubgen.l in the same way because the object file which
is derived from lopsubgen.l is not part of the library. It is only
linked into the lopsubgen executable.

config_file.l
lopsub-internal.h

index 0b8435041fa0a1ba55546e885304ab30442a31f4..b6eff7cc5bd09ae4f4d257ee76be4a4d9279e99e 100644 (file)
@@ -4,6 +4,9 @@
  * Licensed under the LGPL v3, see http://www.gnu.org/licenses/lgpl-3.0.html
  */
 
  * Licensed under the LGPL v3, see http://www.gnu.org/licenses/lgpl-3.0.html
  */
 
+ /* We don't want symbols to clash with those of other flex users. */
+%option prefix="lls_yy"
+
 %option stack
 %option never-interactive
 %option yylineno
 %option stack
 %option never-interactive
 %option yylineno
index 99366d3636b057d4bd1a1784161b3fec7777d1df..bbc2963d46680f6cc46d73e9a3923a328e10359c 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <inttypes.h>
 
 
 #include <inttypes.h>
 
-#define LLS_ABI_VERSION 1
+#define LLS_ABI_VERSION 2
 
 /*
  * Concat "lls_abi_version" and the ABI version number to produce the name of a
 
 /*
  * Concat "lls_abi_version" and the ABI version number to produce the name of a