Change 26786 by [EMAIL PROTECTED] on 2006/01/11 14:23:28

        Get rid of the following gcc format warnings by simplifying the
        getgroups implementation:
        
          mg.c: In function Perl_magic_get':
          mg.c:1008: warning: long unsigned int format, gid_t arg (arg 3)
          mg.c:1014: warning: long unsigned int format, gid_t arg (arg 3)
          mg.c:1025: warning: long unsigned int format, unsigned int arg (arg 3)
        
        Since we already cast the numeric Gid_t values to an IV it should not
        be too risky to also cast the Group_t values.  Converting these values
        with Gid_t_f wasn't quite right anyway.

Affected files ...

... //depot/perl/mg.c#402 edit

Differences ...

==== //depot/perl/mg.c#402 (text) ====
Index: perl/mg.c
--- perl/mg.c#401~26781~        2006-01-11 04:11:03.000000000 -0800
+++ perl/mg.c   2006-01-11 06:23:28.000000000 -0800
@@ -1004,15 +1004,9 @@
        break;
     case '(':
        sv_setiv(sv, (IV)PL_gid);
-#ifdef HAS_GETGROUPS
-       Perl_sv_setpvf(aTHX_ sv, "%"Gid_t_f, PL_gid);
-#endif
        goto add_groups;
     case ')':
        sv_setiv(sv, (IV)PL_egid);
-#ifdef HAS_GETGROUPS
-       Perl_sv_setpvf(aTHX_ sv, "%"Gid_t_f, PL_egid);
-#endif
       add_groups:
 #ifdef HAS_GETGROUPS
        {
@@ -1021,12 +1015,12 @@
             Newx(gary, num_groups, Groups_t);
             num_groups = getgroups(num_groups, gary);
            while (--num_groups >= 0)
-               Perl_sv_catpvf(aTHX_ sv, " %"Gid_t_f,
-                              gary[num_groups]);
+               Perl_sv_catpvf(aTHX_ sv, " %"IVdf,
+                              (IV)gary[num_groups]);
             Safefree(gary);
        }
-#endif
        (void)SvIOK_on(sv);     /* what a wonderful hack! */
+#endif
        break;
 #ifndef MACOS_TRADITIONAL
     case '0':
End of Patch.

Reply via email to