This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: GCC bug breaking Perl_sv_catpvfn()?
authorMarcus Holland-Moritz <mhx-perl@gmx.net>
Fri, 26 Dec 2003 02:47:09 +0000 (03:47 +0100)
committerNicholas Clark <nick@ccl4.org>
Fri, 26 Dec 2003 19:22:16 +0000 (19:22 +0000)
From: "Marcus Holland-Moritz" <mhx-perl@gmx.net>
Message-ID: <03ca01c3cb52$2d509b40$5700a8c0@R2D2>

p4raw-id: //depot/perl@21962

sv.c

diff --git a/sv.c b/sv.c
index 05deb5a..7eba778 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -9052,23 +9052,23 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
            else if (args) {
                switch (intsize) {
                case 'h':       iv = (short)va_arg(*args, int); break;
-               default:        iv = va_arg(*args, int); break;
                case 'l':       iv = va_arg(*args, long); break;
                case 'V':       iv = va_arg(*args, IV); break;
+               default:        iv = va_arg(*args, int); break;
 #ifdef HAS_QUAD
                case 'q':       iv = va_arg(*args, Quad_t); break;
 #endif
                }
            }
            else {
-               iv = SvIVx(argsv);
+               IV tiv = SvIVx(argsv); /* work around GCC bug #13488 */
                switch (intsize) {
-               case 'h':       iv = (short)iv; break;
-               default:        break;
-               case 'l':       iv = (long)iv; break;
-               case 'V':       break;
+               case 'h':       iv = (short)tiv; break;
+               case 'l':       iv = (long)tiv; break;
+               case 'V':
+               default:        iv = tiv; break;
 #ifdef HAS_QUAD
-               case 'q':       iv = (Quad_t)iv; break;
+               case 'q':       iv = (Quad_t)tiv; break;
 #endif
                }
            }
@@ -9136,23 +9136,23 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
            else if (args) {
                switch (intsize) {
                case 'h':  uv = (unsigned short)va_arg(*args, unsigned); break;
-               default:   uv = va_arg(*args, unsigned); break;
                case 'l':  uv = va_arg(*args, unsigned long); break;
                case 'V':  uv = va_arg(*args, UV); break;
+               default:   uv = va_arg(*args, unsigned); break;
 #ifdef HAS_QUAD
                case 'q':  uv = va_arg(*args, Quad_t); break;
 #endif
                }
            }
            else {
-               uv = SvUVx(argsv);
+               UV tuv = SvUVx(argsv); /* work around GCC bug #13488 */
                switch (intsize) {
-               case 'h':       uv = (unsigned short)uv; break;
-               default:        break;
-               case 'l':       uv = (unsigned long)uv; break;
-               case 'V':       break;
+               case 'h':       uv = (unsigned short)tuv; break;
+               case 'l':       uv = (unsigned long)tuv; break;
+               case 'V':
+               default:        uv = tuv; break;
 #ifdef HAS_QUAD
-               case 'q':       uv = (Quad_t)uv; break;
+               case 'q':       uv = (Uquad_t)tuv; break;
 #endif
                }
            }