This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix Solaris bootstrap: lto-common.c, lto-dump.c format mismatches
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org,Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: Martin Liska <mliska at suse dot cz>
- Date: Mon, 06 May 2019 20:46:05 +0200
- Subject: Re: Fix Solaris bootstrap: lto-common.c, lto-dump.c format mismatches
- References: <ydd8svjxwgs.fsf@CeBiTec.Uni-Bielefeld.DE>
On May 6, 2019 8:35:15 PM GMT+02:00, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
>The recent LTO patches broke Solaris bootstrap (both sparc and x86):
>
>/vol/gcc/src/hg/trunk/local/gcc/lto/lto-common.c: In function
>'lto_file_decl_data* lto_file_read(lto_file*, std::FILE*, int*)':
>/vol/gcc/src/hg/trunk/local/gcc/lto/lto-common.c:2114:32: error: format
>'%ld' expects argument of type 'long int', but argument 4 has type
>'intptr_t' {aka 'int'} [-Werror=format=]
> 2114 | fprintf (stdout, "%2d %8ld %8ld %s\n",
> | ~~~^
> | |
> | long int
> | %8d
> 2115 | ++i, section->start, section->len, section->name);
> | ~~~~~~~~~~~~~~
> | |
> | intptr_t {aka int}
>
>/vol/gcc/src/hg/trunk/local/gcc/lto/lto-common.c:2114:37: error: format
>'%ld' expects argument of type 'long int', but argument 5 has type
>'std::size_t' {aka 'unsigned int'} [-Werror=format=]
> 2114 | fprintf (stdout, "%2d %8ld %8ld %s\n",
> | ~~~^
> | |
> | long int
> | %8d
> 2115 | ++i, section->start, section->len, section->name);
> | ~~~~~~~~~~~~
> | |
> | std::size_t {aka unsigned int}
>
>/vol/gcc/src/hg/trunk/local/gcc/lto/lto-dump.c: In member function
>'virtual void symbol_entry::dump()':
>/vol/gcc/src/hg/trunk/local/gcc/lto/lto-dump.c:63:25: error: format
>'%lu' expects argument of type 'long unsigned int', but argument 4 has
>type 'std::size_t' {aka 'unsigned int'} [-Werror=format=]
>63 | printf ("%s %s %4lu %s ", type_name, visibility, sz,
>name);
> | ~~~^ ~~
> | | |
>| long unsigned int std::size_t
>{aka unsigned int}
> | %4u
>
>Fixed as follows. i386-pc-solaris2.11 bootstrap has completed with
>this
>patch, sparc-sun-solaris2.11 is running the testsuite and
>x86_64-pc-linux-gnu is building the runtime libs.
>
>Ok for mainline?
Can you use the PRI* format macros to match the types instead?
Ok with that change.
Richard.
> Rainer