Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Use CC to determine if gcc is used



On Sun, 26 Apr 2015 19:48:31 +0200
Heiko Becker <heirecka@xxxxxxxxxxx> wrote:
> I ran into this with gcc-5.1 and CPP set to x86_64-pc-linux-gnu-cpp
> which isn't catched by the intended case branch and caused zsh to be
> miscompiled in the process.
> ---
>  Src/zsh.mdd | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Src/zsh.mdd b/Src/zsh.mdd
> index 71dd613..3c8c355 100644
> --- a/Src/zsh.mdd
> +++ b/Src/zsh.mdd
> @@ -28,8 +28,8 @@ hdrdeps="zshcurses.h zshterm.h"
>  # on the option to remove them being the same.
>  signames.c: signames1.awk signames2.awk ../config.h @SIGNAL_H@
>  	$(AWK) -f $(sdir)/signames1.awk @SIGNAL_H@ >sigtmp.c
> -	case "$(CPP)" in \
> -	gcc*) \
> +	case "$(CC)" in \
> +	*gcc*) \
>  	$(CPP) -P sigtmp.c >sigtmp.out;; \
>  	*) \
>  	$(CPP) sigtmp.c >sigtmp.out;; \

That's probably OK, but rather than test CC when using CPP, it might be
simpler just to test if $(CPP) contains "gnu" as an alternative to
"gcc"?

I think signames2.awk could probably be smarter as well.  I haven't seen
the problem myself but presumably it must just be a question of ignoring
lines beginning '#[ 	]*[0-9]'?

diff --git a/Src/zsh.mdd b/Src/zsh.mdd
index 71dd613..3159e18 100644
--- a/Src/zsh.mdd
+++ b/Src/zsh.mdd
@@ -29,7 +29,7 @@ hdrdeps="zshcurses.h zshterm.h"
 signames.c: signames1.awk signames2.awk ../config.h @SIGNAL_H@
 	$(AWK) -f $(sdir)/signames1.awk @SIGNAL_H@ >sigtmp.c
 	case "$(CPP)" in \
-	gcc*) \
+	gcc*|*gnu*) \
 	$(CPP) -P sigtmp.c >sigtmp.out;; \
 	*) \
 	$(CPP) sigtmp.c >sigtmp.out;; \


pws



Messages sorted by: Reverse Date, Date, Thread, Author