On 6/10/25 10:15, Sachin T via Gnupg-devel wrote:

[...]

    3. On z/OS, environ is defined as a macro in <stdlib.h>, so it is
    temporarily redefined around the header inclusion to avoid conflicts.

[...]

diff --git a/src/spawn-posix.c b/src/spawn-posix.c
index ac19761..2666862 100644
--- a/src/spawn-posix.c
+++ b/src/spawn-posix.c
@@ -27,8 +27,17 @@

#error This code is only used on POSIX
#endif

+#if defined(__MVS__)
+#define environ environ_replace
+#endif
+
#include <stdio.h>
#include <stdlib.h>
+
+#if defined(__MVS__)
+#undef environ
+#endif
+
#include <stdint.h>
#include <string.h>
#include <errno.h>

What exactly is this dance supposed to do?  The C preprocessor has no equivalent to M4's pushdef()/popdef().

If environ is supposed to be a symbol, then there is no reason to define it before including stdlib.h and undefining it to get rid of the macro.  If the file does not use environ, then why care? If environ's macro definition is actually important on z/OS, then this dance likely causes breakage.

What is this trying to accomplish?


-- Jacob
_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-devel

Reply via email to