public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "me at serhei dot io" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug translator/25845] New: buildrun: type-conversion warnings 32-bit with recent gcc
Date: Fri, 17 Apr 2020 19:31:16 +0000	[thread overview]
Message-ID: <bug-25845-6586@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=25845

            Bug ID: 25845
           Summary: buildrun: type-conversion warnings 32-bit with recent
                    gcc
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: me at serhei dot io
  Target Milestone: ---

Recent GCC (seen on 9.3.1) complain when compiling stap modules for 32-bit
systems. The behaviour that's now being flagged is well-known, unobjectionable
and fairly difficult to get rid of -- it's based on the fact that stap scalar
values are always 64-bit words regardless of the type being store in them. Most
likely, we should suppress the warnings in question, but I'm filing a PR to
keep track of the decision in case there are any surprises.

Example:

as_root /notnfs/smakarov/stap-checkout/stap_install/bin/stap --rlimit-as=1
--rlimit-as=99999999999\
9 -wp4 /notnfs/smakarov/stap-checkout/testsuite/systemtap.base/rlimit.stp
OUT /tmp/stapwwHXqw/stap_2fcc2a5ab281c9226223b81a92db655d_2051647_src.c: In
function 'function___g\
lobal___get_kregs__overload_0':
/tmp/stapwwHXqw/stap_2fcc2a5ab281c9226223b81a92db655d_2051647_src.c:328917:33:
error: cast from po\
inter to integer of different size [-Werror=pointer-to-int-cast]
328917 |      /* guru */ STAP_RETVALUE = (int64_t)CONTEXT->kregs;
       |                                 ^
/tmp/stapwwHXqw/stap_2fcc2a5ab281c9226223b81a92db655d_2051647_src.c: In
function 'function___globa\
l___set_kregs__overload_0':
/tmp/stapwwHXqw/stap_2fcc2a5ab281c9226223b81a92db655d_2051647_src.c:328956:34:
error: cast to poin\
ter from integer of different size [-Werror=int-to-pointer-cast]
328956 |      /* guru */ CONTEXT->kregs = (struct pt_regs*)STAP_ARG_regs;
       |                                  ^
/tmp/stapwwHXqw/stap_2fcc2a5ab281c9226223b81a92db655d_2051647_src.c: In
function 'function___priva\
te__notnfs_smakarov_stap_checkout_testsuite_systemtap_base_rlimit_stp__dwarf_tvar_get_new_rev_269':
/tmp/stapwwHXqw/stap_2fcc2a5ab281c9226223b81a92db655d_2051647_src.c:369039:111:
error: conversion \
from 'long long unsigned int' to 'long unsigned int' changes value from
'18446744070503413664' to \
'1088829344' [-Werror=overflow]
369039 |   l->__retvalue = (((((int64_t) (({ unsigned long addr = 0; addr =
_stp_kmodule_relocate \
("kernel", "_stext", 0xffffffff40e637a0); addr; }))))) &
(((int64_t)4294967295LL)));
       |                                                                       
                  \
                     ^~~~~~~~~~~~~~~~~~
/tmp/stapwwHXqw/stap_2fcc2a5ab281c9226223b81a92db655d_2051647_src.c: In
function 'function___priva\
te__notnfs_smakarov_stap_checkout_testsuite_systemtap_base_rlimit_stp__dwarf_tvar_get_patch_268':
/tmp/stapwwHXqw/stap_2fcc2a5ab281c9226223b81a92db655d_2051647_src.c:376520:111:
error: conversion \
from 'long long unsigned int' to 'long unsigned int' changes value from
'18446744070503409568' to \
'1088825248' [-Werror=overflow]
376520 |   l->__retvalue = (((((int64_t) (({ unsigned long addr = 0; addr =
_stp_kmodule_relocate \
("kernel", "_stext", 0xffffffff40e627a0); addr; }))))) &
(((int64_t)4294967295LL)));
       |                                                                       
                  \
                     ^~~~~~~~~~~~~~~~~~

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

             reply	other threads:[~2020-04-17 19:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-17 19:31 me at serhei dot io [this message]
2020-04-20 14:40 ` [Bug translator/25845] " me at serhei dot io

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=bug-25845-6586@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@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).