[prev in list] [next in list] [prev in thread] [next in thread] 

List:       miros-discuss
Subject:    Re: Initial MirBSD support for pkgsrc
From:       Thorsten Glaser <tg () mirbsd ! de>
Date:       2011-01-15 22:34:14
Message-ID: Pine.BSM.4.64L.1101152230410.26517 () herc ! mirbsd ! org
[Download RAW message or body]

Benny Siegert dixit:

>devel/bmake/files/unit-tests/modts: Using echo in the test is not
>	portable, as it may interpret backslash escapes, depending on
>	the shell. If mksh is used as the shell, it replaces \x by a
>	null byte. Replace echo by printf for the tests in this file to
>	avoid this.

Note that echo is the least portable, anyway, so this ought to go
in definitively, independent on your stance on this mksh's expansion
(there are ways to prevent it, but not selected here).

>The libfetch patch fixes two compiler warnings (-Wformat), which would 
>otherwise make the build fail because -Werror is in effect:

On MirBSD, -Wformat is on to catch exactly this kind of errors, since
we pioneered a 64-bit time_t on an ILP32 platform years before NetBSD ®.

>net/libfetch/files/ftp.c: On some operating systems (notably MirBSD), the
>	tm_year member in struct tm is a long, not an int. The package

This is wrong, it's actually a time_t because some applications, most
notably GNU CVS' configure script (via gnulib), depend on being able
to have a lossless round-trip conversion of any value of time_t to
struct tm and back.

>	tools already have support for this, libfetch does not. Here, use
>	a temporary variable to read in the year so the length is known.

This patch is correct, for int values of tm_year.

>net/libfetch/files/http.c: Same issue as above; cast tm_year to a long
>	before printing it.

-           tm.tm_year + 1900, tm.tm_hour, tm.tm_min, tm.tm_sec);
+           (long)tm.tm_year + 1900, tm.tm_hour, tm.tm_min, tm.tm_sec);

I think (long)(tm.tm_year + 1900) would be better. Or casting to int,
which can be changed to int64_t if pkgsrc ® is still around by then.
Casting to long involves quite some overhead on current LP64 platforms.

bye,
//mirabilos
-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool."
						-- Edward Burr

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic