Bug 1033 - sync mktime.c from gnulib
Summary: sync mktime.c from gnulib
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.3.5
: P2 normal
Target Milestone: ---
Assignee: GOTO Masanori
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-23 07:28 UTC by Paul Eggert
Modified: 2005-09-16 13:08 UTC (History)
1 user (show)

See Also:
Host: all
Target:
Build:
Last reconfirmed:


Attachments
mktime.c import from gnulib (1.92 KB, patch)
2005-06-23 07:29 UTC, Paul Eggert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggert 2005-06-23 07:28:14 UTC
Here is a patch to bring glibc mktime.c into sync with gnulib mktime.c.

The gnulib mktime.c uses a different method to avoid the GCC 4.0.0 warning,
one that generated 128 bytes less machine code on my platform (x86, gcc -O2).
Also, there is some other minor reorganization of the gnulib type macros
to make them consistent with other gnulib code.

This change does not affect behavior, other than the minor effect on
efficiency.

I'll attach the patch.
Comment 1 Paul Eggert 2005-06-23 07:29:01 UTC
Created attachment 530 [details]
mktime.c import from gnulib
Comment 2 cvs-commit@gcc.gnu.org 2005-09-08 08:09:15 UTC
Subject: Bug 1033

CVSROOT:	/cvs/glibc
Module name:	libc
Changes by:	roland@sources.redhat.com	2005-09-08 08:09:08

Modified files:
	time           : mktime.c 

Log message:
	2005-06-23  Paul Eggert  <eggert@cs.ucla.edu>
	
	[BZ #1033]
	* time/mktime.c: Import from gnulib.
	The following macros are now consistent with other gnulib code.
	This does not change mktime's behavior.
	(TYPE_IS_INTEGER): New macro.
	(time_t_is_integer): Use it.
	(TYPE_TWOS_COMPLEMENT): New macro.
	(twos_complement_arithmetic): Use it.
	(TYPE_ONES_COMPLEMENT): New macro.
	(TYPE_MINIMUM, TYPE_MAXIMUM): Now supports signed-magnitude.
	mktime doesn't use this, but the code now matches other gnulib code.
	(ranged_convert): Pacify GCC 4.0 in a different way, which
	generates a few bytes less code.
	(ranged_convert, __mktime_internal): When calling a function via a
	pointer P, use P () rather than (*P) (), as we now assume C89 or
	better.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/time/mktime.c.diff?cvsroot=glibc&r1=1.65&r2=1.66

Comment 3 Andreas Jaeger 2005-09-16 13:08:35 UTC
Fixed.