From: Gisle Aas Date: Wed, 11 Jan 2006 14:23:28 +0000 (+0000) Subject: Get rid of the following gcc format warnings by simplifying the X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cd70abae37f0090fad1d3fa318844341095d33b2;p=p5sagit%2Fp5-mst-13.2.git 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. p4raw-id: //depot/perl@26786 --- diff --git a/mg.c b/mg.c index 603e8ac..51655af 100644 --- a/mg.c +++ b/mg.c @@ -1004,15 +1004,9 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) 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 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) 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':