Skip Menu |
 

This queue is for tickets about the Sys-Syslog CPAN distribution.

Report information
The Basics
Id: 77578
Status: resolved
Priority: 0/
Queue: Sys-Syslog

People
Owner: SAPER [...] cpan.org
Requestors: TONYC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.29
Fixed in: 0.30



Subject: "Constant subroutine LOG_FACMASK redefined" on Haiku-OS
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1338553765-23796-5"
Content-Length: 0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 1656
Download (untitled) / with headers
text/plain 1.6k
With the change in RT #77577 Syslog successfully builds under bleadperl, but during make test, I see: ~/dev/perl/git/perl/t> ./perl harness ../cpan/Sys-Syslog/t/*.t ../cpan/Sys-Syslog/t/00-load.t .... Constant subroutine LOG_FACMASK redefined at ../../lib/Sys/Syslog.pm line -1. ../cpan/Sys-Syslog/t/00-load.t .... ok ../cpan/Sys-Syslog/t/constants.t .. Constant subroutine LOG_FACMASK redefined at ../../lib/Sys/Syslog.pm line -1. ../cpan/Sys-Syslog/t/constants.t .. ok ../cpan/Sys-Syslog/t/syslog.t ..... Constant subroutine LOG_FACMASK redefined at ../../lib/Sys/Syslog.pm line -1. ../cpan/Sys-Syslog/t/syslog.t ..... ok All tests successful. Files=3, Tests=309, 1 wallclock secs ( 0.04 usr 0.01 sys + 0.33 cusr 0.11 csys = 0.48 CPU) Result: PASS This happens because Haiku-OS doesn't define LOG_FACMASK, so at the point const-c.inc is included LOC_FACMASK isn't defined, so it defines a LOG_FACMASK using the fallback value. The LOG_FACMASK macro is then defined and const-xs.inc is included, that file seeing the macro is defined also creates a CONSTSUB, producing the warning above. Moving the macro definition above the const-c.inc include prevents the warning. ~/dev/perl/git/perl/t> ./perl harness ../cpan/Sys-Syslog/t/*.t ../cpan/Sys-Syslog/t/00-load.t .... ok ../cpan/Sys-Syslog/t/constants.t .. ok ../cpan/Sys-Syslog/t/syslog.t ..... ok All tests successful. Files=3, Tests=309, 1 wallclock secs ( 0.04 usr 0.01 sys + 0.34 cusr 0.11 csys = 0.49 CPU) Result: PASS I've attached a patch with the fix. It's also present in the haiku branch at: https://github.com/tonycoz/Sys-Syslog/tree/haiku Tony
Subject: facmask.patch
MIME-Version: 1.0
Content-Type: text/x-diff; name="facmask.patch"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline; filename="facmask.patch"
Content-Transfer-Encoding: binary
Content-Length: 513
Download facmask.patch
text/x-diff 513b
diff --git a/Syslog.xs b/Syslog.xs index 4bdbb3b..729ce9c 100644 --- a/Syslog.xs +++ b/Syslog.xs @@ -31,17 +31,17 @@ static SV *ident_svptr; +#ifndef LOG_FAC +#define LOG_FACMASK 0x03f8 +#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) +#endif + #include "const-c.inc" #ifndef LOG_PRIMASK #define LOG_PRIMASK 7 #endif -#ifndef LOG_FAC -#define LOG_FACMASK 0x03f8 -#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) -#endif - #ifndef LOG_PRI #define LOG_PRI(p) ((p) & LOG_PRIMASK) #endif
From saper [...] cpan.org Tue Aug 14 21: 21:00 2012
MIME-Version: 1.0 (Apple Message framework v1278)
X-Spam-Status: No, score=-6.675 tagged_above=-99.9 required=10 tests=[AWL=0.225, BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5] autolearn=ham
In-Reply-To: <rt-3.8.HEAD-23796-1338553765-1427.77578-4-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.1278)
X-Spam-Flag: NO
References: <RT-Ticket-77578 [...] rt.cpan.org> <rt-3.8.HEAD-23796-1338553765-1427.77578-4-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Content-Type: text/plain; charset="utf-8"
Message-ID: <9FF2A852-9229-4B58-88DD-4024F4AF7FFE [...] cpan.org>
X-RT-Original-Encoding: utf-8
X-Spam-Score: -6.675
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id D378924070D for <cpan-bug+Sys-Syslog [...] hipster.bestpractical.com>; Tue, 14 Aug 2012 21:21:00 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iZvsIkAcjB5X for <cpan-bug+Sys-Syslog [...] hipster.bestpractical.com>; Tue, 14 Aug 2012 21:20:56 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id C77212405BF for <bug-Sys-Syslog [...] rt.cpan.org>; Tue, 14 Aug 2012 21:20:55 -0400 (EDT)
Received: (qmail 11691 invoked by uid 103); 15 Aug 2012 01:20:54 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 15 Aug 2012 01:20:54 -0000
Received: from smtp1-g21.free.fr (HELO smtp1-g21.free.fr) (212.27.42.1) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Tue, 14 Aug 2012 18:20:51 -0700
Received: from [IPv6:2a01:e35:2f26:dde0:f1f8:f04e:d935:c27a] (unknown [IPv6:2a01:e35:2f26:dde0:f1f8:f04e:d935:c27a]) by smtp1-g21.free.fr (Postfix) with ESMTP id 75824940089 for <bug-Sys-Syslog [...] rt.cpan.org>; Wed, 15 Aug 2012 03:20:42 +0200 (CEST)
Delivered-To: cpan-bug+Sys-Syslog [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #77578] "Constant subroutine LOG_FACMASK redefined" on Haiku-OS
Return-Path: <saper [...] cpan.org>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+Sys-Syslog [...] hipster.bestpractical.com
X-RT-Mail-Extension: sys-syslog
Date: Wed, 15 Aug 2012 03:20:40 +0200
X-Spam-Level:
To: bug-Sys-Syslog [...] rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
RT-Message-ID: <rt-3.8.HEAD-22238-1344993661-308.77578-0-0 [...] rt.cpan.org>
Content-Length: 903
Download (untitled) / with headers
text/plain 903b
Tony Cook wrote via RT: Show quoted text
> With the change in RT #77577 Syslog successfully builds under bleadperl, > but during make test, I see: > > ~/dev/perl/git/perl/t> ./perl harness ../cpan/Sys-Syslog/t/*.t > ../cpan/Sys-Syslog/t/00-load.t .... Constant subroutine LOG_FACMASK > redefined at ../../lib/Sys/Syslog.pm line -1. > […] > > This happens because Haiku-OS doesn't define LOG_FACMASK, so at the > point const-c.inc is included LOC_FACMASK isn't defined, so it defines a > LOG_FACMASK using the fallback value. > > The LOG_FACMASK macro is then defined and const-xs.inc is included, that > file seeing the macro is defined also creates a CONSTSUB, producing the > warning above. > > Moving the macro definition above the const-c.inc include prevents the > warning.
Thanks, applied. It will be included in Sys::Syslog version 0.30 -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.