Skip Menu |

This queue is for tickets about the File-ExtAttr CPAN distribution.

Report information
The Basics
Id: 21214
Status: resolved
Priority: 0/
Queue: File-ExtAttr

People
Owner: richdawe [...] cpan.org
Requestors: cjm [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.05
Fixed in: 1.01



Subject: ISO C90 forbids mixed declarations and code
When building File-ExtAttr-0.05, I get a number of warnings about "ISO C90 forbids mixed declarations and code". This is because variables need to be declared in PREINIT: blocks instead of CODE: blocks. Recent versions of GCC let you get away with mixing code and declarations, but other compilers may not. I've attached a patch to clean that up. Other than that, it's been working well and is just what I was looking for. Thanks.
Subject: preinit.patch
--- ExtAttr.xs$ 2006-03-06 14:53:47.000000000 -0600 +++ ExtAttr.xs 2006-08-27 14:51:58.404940974 -0500 @@ -26,11 +26,12 @@ const char *attrname SV * attrvalueSV int flags - CODE: + PREINIT: STRLEN slen; char * attrvalue; int rc; + CODE: attrvalue = SvPV(attrvalueSV, slen); rc = portable_setxattr(path, attrname, attrvalue, slen, flags); if (rc == -1) @@ -49,11 +50,12 @@ const char *attrname SV * attrvalueSV int flags - CODE: + PREINIT: STRLEN slen; char * attrvalue; int rc; + CODE: attrvalue = SvPV(attrvalueSV, slen); rc = portable_fsetxattr(fd, attrname, attrvalue, slen, flags); if (rc == -1) @@ -71,11 +73,12 @@ const char *path const char *attrname int flags - CODE: + PREINIT: char * attrvalue; int attrlen; ssize_t buflen; + CODE: buflen = portable_lenxattr(path, attrname); if (buflen <= 0) buflen = SvIV(get_sv(MAX_INITIAL_VALUELEN_VARNAME, FALSE)); @@ -110,11 +113,12 @@ int fd const char *attrname int flags - CODE: + PREINIT: char * attrvalue; int attrlen; ssize_t buflen; + CODE: buflen = portable_flenxattr(fd, attrname); if (buflen <= 0) buflen = SvIV(get_sv(MAX_INITIAL_VALUELEN_VARNAME, FALSE)); @@ -172,7 +176,7 @@ const char *path int fd int flags - INIT: + PREINIT: ssize_t size, ret; char *namebuf = NULL; char *nameptr;
Subject: Re: [rt.cpan.org #21214] ISO C90 forbids mixed declarations and code
Date: Tue, 29 Aug 2006 19:24:31 +0100
To: bug-File-ExtAttr [...] rt.cpan.org
From: Richard Dawe <rich [...] phekda.gotadsl.co.uk>
Thanks for the patch! This is actually already fixed in CVS. See <http://sourceforge.net/cvs/?group_id=153116> for details of File::ExtAttr's CVS repository. I hope to release File::ExtAttr 1.00 sometime in the next two weeks. Perhaps even this coming weekend.
This is fixed in version 1.01, which I've just uploaded to CPAN. Thanks for your bug report & patch!