Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: More trouble with strtoul Date: Fri, 20 Mar 2015 13:41:09 -0700 Organization: None to speak of Lines: 28 Message-ID: <87wq2bwgey.fsf@kst-u.example.com> References: <6ilnga1dp3mj4vaj8oee3jqvmf73qus1jt@4ax.com> <87iodvy8j2.fsf@kst-u.example.com> <87619vy3l0.fsf@kst-u.example.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="c77ff4d35e33d1c939d3461ebde8dd0d"; logging-data="8290"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gwsT8SwO+zP8KEhrAxHB0" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:GIVRZwCNLSHuTq+p5MHfXkjP0Ms= sha1:vWkBwKNk6+9uYOvVVQ2WYrg/c1E= Xref: csiph.com comp.lang.c:58541 Ian Collins writes: > Keith Thompson wrote: >> glen herrmannsfeldt writes: >>> Keith Thompson wrote: >>> >>> (snip on printing difference of pointers) >>> >>>> Is that the exact code you ran? I get several warnings when I compile >>>> it. On line 13, "%lld" is the incorrect format for end-s (unless >>>> ptrdiff_t happens to be long long). I suggest: >>> >>>> printf("%lu %d", m, (int)end-s); >>> >>> I would have done (int)(end-s). >> >> You're right, of course. In fact I did that; I should have >> copy-and-pasted my working code rather than re-typing it. > > Why would you do that when, as you pointed out else-thread, there is %td? Because I hadn't yet remembered the existence of %td when I posted that first followup. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"