Categories
Uncategorized

XML::Genx Compiler Warnings

Naturally, one of the first things I did when I got the new mac was to try compiling my software, XML::Genx, on it. Sadly, it throws up a number of errors.

Genx.xs: In function 'string_sender_write':
Genx.xs:209: warning: pointer targets in passing argument 3 of 'Perl_sv_catpv' differ in signedness
Genx.xs: In function 'string_sender_write_bounded':
Genx.xs:223: warning: pointer targets in passing argument 3 of 'Perl_sv_catpvn_flags' differ in signedness
Genx.xs: In function 'XS_XML__Genx_ScrubText':
Genx.xs:606: warning: pointer targets in passing argument 2 of 'genxScrubText' differ in signedness
Genx.xs:606: warning: pointer targets in passing argument 3 of 'genxScrubText' differ in signedness
Genx.c: In function 'XS_XML__Genx__Namespace_GetNamespacePrefix':
Genx.c:1068: warning: pointer targets in passing argument 3 of 'Perl_sv_setpv' differ in signedness

Looking around the web, it appears that this is a new warning in gcc 4.0. It also baffles me that that apple would have considered using signed characters for anything by default. However, the obvious fix doesn’t work.

-        sv_catpv( *svp, s );
+        sv_catpv( *svp, (signed char *)s );

At this point, I suspect that my knowledge of C is fundamentally lacking. Does anybody out there have any ideas what I need to do to fix this warning? The source is string_sender_write() in Genx.xs, although you’ll probably also want genx.h to look for the typedefs.

Sadly, the gcc manual doesn’t have much to say, except to note the existence of -Wno-pointer-sign to disable the warning. But I’d rather fix it if I can.

Categories
Uncategorized

Typo TimeZones

One minor annoyance that I’ve noticed since I started using typo is that the times are out by about 8 hours. For instance, this post probably says “created 8 hours ago”, even though I created it only a few minutes ago. Looking at the previous post in the database, which has never been edited:

created_at     | 2006-01-24 00:29:00
updated_at     | 2006-01-24 08:52:04

The updated_at field is correct.

So now I have to figure out which of the many components is defaulting to Eastern Standard Time. Could it be Ruby? Rails? PostgreSQL? Apache? JavaScript? Safari? Who knows, I have to go to work now…

Update: It turns out that HowtoSetDefaultTimeZone has the answer. Put this into config/environment.rb:

ActiveRecord::Base.default_timezone = :utc