From owner-svn-src-head@freebsd.org Thu Apr 26 15:30:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DF77FB0903 for ; Thu, 26 Apr 2018 15:30:46 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24CDC7EA74 for ; Thu, 26 Apr 2018 15:30:45 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a1342f1d-4966-11e8-91c6-33ffc249f3e8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id a1342f1d-4966-11e8-91c6-33ffc249f3e8; Thu, 26 Apr 2018 15:29:38 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w3QFTUe8024935; Thu, 26 Apr 2018 09:29:30 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1524756570.57768.115.camel@freebsd.org> Subject: Re: svn commit: r333010 - head/sys/mips/mips From: Ian Lepore To: Li-Wen Hsu Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 26 Apr 2018 09:29:30 -0600 In-Reply-To: References: <201804251946.w3PJkdkH040243@repo.freebsd.org> <1524700799.57768.111.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 15:30:47 -0000 On Thu, 2018-04-26 at 19:01 +0800, Li-Wen Hsu wrote: > On Thu, Apr 26, 2018 at 7:59 AM, Ian Lepore wrote: > > > > On Wed, 2018-04-25 at 19:46 +0000, Li-Wen Hsu wrote: > > > > > > Author: lwhsu (ports committer) > > > Date: Wed Apr 25 19:46:39 2018 > > > New Revision: 333010 > > > URL: https://svnweb.freebsd.org/changeset/base/333010 > > > > > > Log: > > >   Fix mips32 build after r332951. > > > > > >   Approved by:        jhb > > > > > > Modified: > > >   head/sys/mips/mips/pm_machdep.c > > > > > > Modified: head/sys/mips/mips/pm_machdep.c > > > ============================================================================== > > > --- head/sys/mips/mips/pm_machdep.c   Wed Apr 25 18:59:29 2018        (r333009) > > > +++ head/sys/mips/mips/pm_machdep.c   Wed Apr 25 19:46:39 2018        (r333010) > > > @@ -264,7 +264,7 @@ ptrace_single_step(struct thread *td) > > >               va = locr0->pc + 4; > > >       } > > >       if (td->td_md.md_ss_addr) { > > > -             printf("SS %s (%d): breakpoint already set at %lx (va %lx)\n", > > > +             printf("SS %s (%d): breakpoint already set at %zx (va %zx)\n", > > >                   p->p_comm, p->p_pid, td->td_md.md_ss_addr, va); /* XXX */ > > >               error = EFAULT; > > >               goto out; > > > @@ -500,7 +500,7 @@ ptrace_clear_single_step(struct thread *td) > > > > > >       if (error != 0) { > > >               log(LOG_ERR, > > > -                 "SS %s %d: can't restore instruction at %lx: %x\n", > > > +                 "SS %s %d: can't restore instruction at %zx: %x\n", > > >                   p->p_comm, p->p_pid, td->td_md.md_ss_addr, > > >                   td->td_md.md_ss_instr); > > >       } > > > > > This isn't right either.  %z is for size_t values, both md_ss_addr and > > va are integers and a plain %x should be the right format. > But it will break mips64: > > cc1: warnings being treated as errors > /home/lwhsu/src/sys/mips/mips/pm_machdep.c: In function 'ptrace_single_step': > /home/lwhsu/src/sys/mips/mips/pm_machdep.c:268: warning: format '%x' > expects type 'unsigned int', but argument 4 has type 'uintptr_t' > [-Wformat] > /home/lwhsu/src/sys/mips/mips/pm_machdep.c:268: warning: format '%x' > expects type 'unsigned int', but argument 5 has type 'uintptr_t' > [-Wformat] > /home/lwhsu/src/sys/mips/mips/pm_machdep.c: In function > 'ptrace_clear_single_step': > /home/lwhsu/src/sys/mips/mips/pm_machdep.c:505: warning: format '%x' > expects type 'unsigned int', but argument 5 has type 'uintptr_t' > [-Wformat] > *** [pm_machdep.o] Error code 1 > > Another way is cast arguments to uintmax_t and use %jx.  Will that be better? > > Li-Wen > Oh, my bad, my source was out of date. Now I see that the types are not plain integers anymore. In that case, I think the only options are to cast to uintmax_t and use %jx, or cast to void* and use %p. -- Ian