This is the mail archive of the
mailing list for the glibc project.
Re: [RFC][BZ #15799] Make div cross-platform.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 25 Oct 2013 20:19:56 +0000
- Subject: Re: [RFC][BZ #15799] Make div cross-platform.
- Authentication-results: sourceware.org; auth=none
- References: <20131025182101 dot GD21615 at domone dot podge> <Pine dot LNX dot 4 dot 64 dot 1310252002400 dot 17813 at digraph dot polyomino dot org dot uk> <20131025201557 dot GA8125 at domone dot podge>
On Fri, 25 Oct 2013, Ondrej Bilka wrote:
> On Fri, Oct 25, 2013 at 08:09:20PM +0000, Joseph S. Myers wrote:
> > On Fri, 25 Oct 2013, Ondrej Bilka wrote:
> > > Hi, following bug report complains that division does not satisfy c
> > > standard.
> > The bug report is about code that can never be executed - that is, the
> > logic errors in it are of no significance. Everything after the
> > assignments to result.quot and result.rem, except for the return
> > statement, should just be deleted as irrelevant given C99 semantics for
> > division, and those assignments should be left unchanged. This should be
> > done for all of div, ldiv and lldiv. This code is not shared with gnulib,
> > so random C90 compilers are irrelevant to it.
> Then close that bug as invalid.
It's a perfectly valid bug report of useless and confusing code in the
glibc source code, just like a report of spelling errors in the sources is
valid. I agree with the statement in the bug that "This means that
div(numer, denom) should simply return the results of numer / denom and
numer % denom directly (C99 section 188.8.131.52), and the old incomplete
run-time test-and-adjustment code (and the obsolete comment block) should
be removed entirely.". It simply isn't *user-visible* (which means (a) no
need to add testcases when fixing it, (b) if it hadn't already been
reported in Bugzilla, there would be no need for anyone fixing it to file
a bug there).
Joseph S. Myers