pkubowicz / opendetex

Improved version of Detex - tool for extracting plain text from TeX and LaTeX sources
Other
236 stars 34 forks source link

NO_MALLOC_DECL redefinition warning #80

Closed kberry closed 9 months ago

kberry commented 2 years ago

NO_MALLOC_DECL might be defined on the command line, in which case gcc gives a (useless IMHO) warning. Protect the definition in the code to avoid this.

--- detex-src/detex.l   (revision 64397)
+++ detex-src/detex.l   (working copy)
@@ -110,7 +110,10 @@
 #define STRIPARGS(x)   cArgs=x; LaBEGIN LaMacro2
 #define        CITE(x)         if (fLatex && !fCite) KILLARGS(x)

+/* avoid gratuitous gcc warning from passing -D for this on command line */
+#ifndef NO_MALLOC_DECL
 #define NO_MALLOC_DECL
+#endif

 void LineBreak();
 void Ignore();