public inbox for ecos-bugs@sourceware.org
help / color / mirror / Atom feed
From: bugzilla-daemon@bugs.ecos.sourceware.org
To: unassigned@bugs.ecos.sourceware.org
Subject: [Bug 1001510] Fix compiler warnings about mismatch between log() format string and argument values.
Date: Tue, 06 Mar 2012 22:05:00 -0000	[thread overview]
Message-ID: <20120306220433.2B0172F78001@mail.ecoscentric.com> (raw)
In-Reply-To: <bug-1001510-777@http.bugs.ecos.sourceware.org/>

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001510

Grant Edwards <grant.b.edwards@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|NOTABUG                     |

--- Comment #4 from Grant Edwards <grant.b.edwards@gmail.com> 2012-03-06 22:04:31 GMT ---
For some reason, I wasn't getting warnings for a while, but now I am
getting them again.  I'm a little puzzled by this, but here are the
warnings I'm getting with gcc 4.6.2:

bsd_tcpip/current/src/ecos/support.c:543:5: warning: format '%ld' expects
argument of type 'long int', but argument 3 has type 'time_t' [-Wformat]
bsd_tcpip/current/src/ecos/support.c:543:5: warning: format '%ld' expects
argument of type 'long int', but argument 4 has type 'time_t' [-Wformat]
bsd_tcpip/current/src/ecos/support.c:551:5: warning: format '%ld' expects
argument of type 'long int', but argument 3 has type 'time_t' [-Wformat]
bsd_tcpip/current/src/ecos/support.c:551:5: warning: format '%ld' expects
argument of type 'long int', but argument 4 has type 'time_t' [-Wformat]
bsd_tcpip/current/src/ecos/support.c:559:5: warning: format '%ld' expects
argument of type 'long int', but argument 3 has type 'time_t' [-Wformat]
bsd_tcpip/current/src/ecos/support.c:559:5: warning: format '%ld' expects
argument of type 'long int', but argument 4 has type 'time_t' [-Wformat]

It looks like tv_sec is always time_t (signed int), but depending on
CDL options, tv_usec can be time_t or unsigned long.  I'm now thinking
the right thing to do is to leave the format as %ld and cast each of
the parameters to (long).  Assuming the fields remain signed types,
that should work correctly regardless of whether they're (int) or
(long int).

Any opinions on whether we should change the format from "%ld.%ld" to
"%ld.%06ld"?  With the current format, 1sec+6usec is displayed as
"1.6" -- I think it would be more intuitive if it were displayed as
"1.000006" but I don't know if that's going to break some sort of
automated regression testing.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


  parent reply	other threads:[~2012-03-06 22:05 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 22:16 [Bug 1001510] New: " bugzilla-daemon
2012-03-03  3:52 ` [Bug 1001510] " bugzilla-daemon
2012-03-03 16:12 ` bugzilla-daemon
2012-03-06 19:32 ` bugzilla-daemon
2012-03-06 22:05 ` bugzilla-daemon [this message]
2012-03-06 22:15 ` bugzilla-daemon
2012-03-09  3:38 ` bugzilla-daemon
2012-03-09  3:40 ` bugzilla-daemon
2012-03-09 14:57 ` bugzilla-daemon
2012-03-09 15:09 ` bugzilla-daemon
2012-03-09 16:40 ` bugzilla-daemon
2012-03-09 16:53 ` bugzilla-daemon
2012-03-13 14:38 ` bugzilla-daemon
2012-03-13 16:09 ` bugzilla-daemon
  -- strict thread matches above, loose matches on Subject: below --
2012-03-02 22:16 [Bug 1001510] New: " bugzilla-daemon
2012-03-03  3:52 ` [Bug 1001510] " bugzilla-daemon
2012-03-03 16:12 ` bugzilla-daemon
2012-03-06 19:32 ` bugzilla-daemon
2012-03-06 22:04 ` bugzilla-daemon
2012-03-06 22:15 ` bugzilla-daemon
2012-03-09  3:39 ` bugzilla-daemon
2012-03-09  3:40 ` bugzilla-daemon
2012-03-09 14:57 ` bugzilla-daemon
2012-03-09 15:09 ` bugzilla-daemon
2012-03-09 16:40 ` bugzilla-daemon
2012-03-09 16:53 ` bugzilla-daemon
2012-03-13 14:38 ` bugzilla-daemon
2012-03-13 16:09 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120306220433.2B0172F78001@mail.ecoscentric.com \
    --to=bugzilla-daemon@bugs.ecos.sourceware.org \
    --cc=unassigned@bugs.ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).