[Bug tapsets/26249] New: [PATCH] uconversions format error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘void *’ [-Werror=format=]

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug tapsets/26249] New: [PATCH] uconversions format error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘void *’ [-Werror=format=]

Sourceware - systemtap mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26249

            Bug ID: 26249
           Summary: [PATCH] uconversions format error: format ‘%lx’
                    expects argument of type ‘long unsigned int’, but
                    argument 5 has type ‘void *’ [-Werror=format=]
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: craig.ringer at 2ndquadrant dot com
  Target Milestone: ---

Please apply the following fix:

    sed -i 's/user string copy fault at 0x%lx/user string copy fault at 0x%p/g'
tapset/uconversions.stp

to prevent this error on gcc 10.1.1 (Fedora 32):

/tmp/stapZ1uHM9/stap_35d624015b7561890f7e266d60669c82_7434_src.c: In function
‘function___global_user_string_n_warn__overload_1’:
/tmp/stapZ1uHM9/stap_35d624015b7561890f7e266d60669c82_7434_src.c:1139:40:
error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument
5 has type ‘void *’ [-Werror=format=]
 1139 |     "user string copy fault 0x%ld at %lx [man error::fault]", rc,
      |                                      ~~^
      |                                        |
      |                                        long unsigned int
      |                                      %p

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug tapsets/26249] [PATCH] uconversions format error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘void *’ [-Werror=format=]

Sourceware - systemtap mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26249

--- Comment #1 from Craig Ringer <craig.ringer at 2ndquadrant dot com> ---
This one too

    user string copy fault 0x%ld at %lx

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug tapsets/26249] [PATCH] uconversions format error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘void *’ [-Werror=format=]

Sourceware - systemtap mailing list
In reply to this post by Sourceware - systemtap mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26249

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com

--- Comment #2 from Frank Ch. Eigler <fche at redhat dot com> ---
Good catch, but I'd rather have the code switch to %lx and (unsigned long)
casts, rather than %p (which is sometimes censored).

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug tapsets/26249] [PATCH] uconversions format error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘void *’ [-Werror=format=]

Sourceware - systemtap mailing list
In reply to this post by Sourceware - systemtap mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26249

--- Comment #3 from Craig Ringer <craig.ringer at 2ndquadrant dot com> ---
OK, good to know. I'll prep a patch.

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug tapsets/26249] [PATCH] uconversions format error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘void *’ [-Werror=format=]

Sourceware - systemtap mailing list
In reply to this post by Sourceware - systemtap mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26249

Craig Ringer <craig.ringer at 2ndquadrant dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |craig.ringer at 2ndquadrant dot co
                   |                            |m

--- Comment #4 from Craig Ringer <craig.ringer at 2ndquadrant dot com> ---
Created attachment 12711
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12711&action=edit
Switch uconversions.stp from %p to %lx

Patch attached as suggested.

I switched all the %p and %lx formats to a consistent form.

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug tapsets/26249] [PATCH] uconversions format error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘void *’ [-Werror=format=]

Sourceware - systemtap mailing list
In reply to this post by Sourceware - systemtap mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26249

--- Comment #5 from Craig Ringer <craig.ringer at 2ndquadrant dot com> ---
Created attachment 12712
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12712&action=edit
Same for linux/conversions.stp

Also attached a similar change for linux/conversions.stp

I didn't run patch 0002 through the tests, so it's just here in case it's
useful. Patch 0001 is sufficient to fix the reported bug.

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug tapsets/26249] [PATCH] uconversions format error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘void *’ [-Werror=format=]

Sourceware - systemtap mailing list
In reply to this post by Sourceware - systemtap mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=26249

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #6 from Frank Ch. Eigler <fche at redhat dot com> ---
merged, thanks!

--
You are receiving this mail because:
You are the assignee for the bug.