public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libctf: eschew %zi format specifier
@ 2019-06-05 12:38 Nick Alcock
  2019-06-05 13:13 ` Jose E. Marchesi
  2019-06-05 13:47 ` Tom Tromey
  0 siblings, 2 replies; 6+ messages in thread
From: Nick Alcock @ 2019-06-05 12:38 UTC (permalink / raw)
  To: binutils; +Cc: jose.marches, tom.tromey

Too many platforms don't support it, and we can always safely use %lu or
%li anyway, because the only uses are in debugging output.

libctf/
	* ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
	(ctf_arc_open_by_offset): Likewise.
	* ctf-create.c (ctf_add_type): Likewise.
---
 libctf/ChangeLog     | 6 ++++++
 libctf/ctf-archive.c | 7 ++++---
 libctf/ctf-create.c  | 7 ++++---
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/libctf/ChangeLog b/libctf/ChangeLog
index 7fb72318b5..6b0a425353 100644
--- a/libctf/ChangeLog
+++ b/libctf/ChangeLog
@@ -1,3 +1,9 @@
+2019-06-05  Nick Alcock  <nick.alcock@oracle.com>
+
+	* ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
+	(ctf_arc_open_by_offset): Likewise.
+	* ctf-create.c (ctf_add_type): Likewise.
+
 2019-06-04  Tom Tromey  <tromey@adacore.com>
 
 	* ctf-create.c (ctf_add_encoded, ctf_add_slice)
diff --git a/libctf/ctf-archive.c b/libctf/ctf-archive.c
index 90cd020b78..24144937a7 100644
--- a/libctf/ctf-archive.c
+++ b/libctf/ctf-archive.c
@@ -68,7 +68,8 @@ ctf_arc_write (const char *file, ctf_file_t ** ctf_files, size_t ctf_file_cnt,
   off_t nameoffs;
   struct ctf_archive_modent *modent;
 
-  ctf_dprintf ("Writing archive %s with %zi files\n", file, ctf_file_cnt);
+  ctf_dprintf ("Writing archive %s with %lu files\n", file,
+	       (unsigned long) ctf_file_cnt);
 
   if ((fd = open (file, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0666)) < 0)
     {
@@ -82,7 +83,7 @@ ctf_arc_write (const char *file, ctf_file_t ** ctf_files, size_t ctf_file_cnt,
      uint64_t's.  */
   headersz = sizeof (struct ctf_archive)
     + (ctf_file_cnt * sizeof (uint64_t) * 2);
-  ctf_dprintf ("headersz is %zi\n", headersz);
+  ctf_dprintf ("headersz is %lu\n", (unsigned long) headersz);
 
   /* From now on we work in two pieces: an mmap()ed region from zero up to the
      headersz, and a region updated via write() starting after that, containing
@@ -510,7 +511,7 @@ ctf_arc_open_by_offset (const struct ctf_archive *arc,
   ctf_sect_t ctfsect;
   ctf_file_t *fp;
 
-  ctf_dprintf ("ctf_arc_open_by_offset(%zi): opening\n", offset);
+  ctf_dprintf ("ctf_arc_open_by_offset(%lu): opening\n", (unsigned long) offset);
 
   memset (&ctfsect, 0, sizeof (ctf_sect_t));
 
diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c
index 356d51295f..5bcc36eff8 100644
--- a/libctf/ctf-create.c
+++ b/libctf/ctf-create.c
@@ -1822,9 +1822,10 @@ ctf_add_type (ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type)
 		ctf_type_size (dst_fp, dst_type))
 	      {
 		ctf_dprintf ("Conflict for type %s against ID %lx: "
-			     "union size differs, old %zi, new %zi\n",
-			     name, dst_type, ctf_type_size (src_fp, src_type),
-			     ctf_type_size (dst_fp, dst_type));
+			     "union size differs, old %li, new %li\n",
+			     name, dst_type,
+			     (long) ctf_type_size (src_fp, src_type),
+			     (long) ctf_type_size (dst_fp, dst_type));
 		return (ctf_set_errno (dst_fp, ECTF_CONFLICT));
 	      }
 
-- 
2.21.0.237.gd0cfaa883d

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] libctf: eschew %zi format specifier
  2019-06-05 12:38 [PATCH] libctf: eschew %zi format specifier Nick Alcock
@ 2019-06-05 13:13 ` Jose E. Marchesi
  2019-06-05 13:47 ` Tom Tromey
  1 sibling, 0 replies; 6+ messages in thread
From: Jose E. Marchesi @ 2019-06-05 13:13 UTC (permalink / raw)
  To: Nick Alcock; +Cc: binutils, jose.marches, tom.tromey


Hi Nick.

    Too many platforms don't support it, and we can always safely use %lu or
    %li anyway, because the only uses are in debugging output.
    
    libctf/
    	* ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
    	(ctf_arc_open_by_offset): Likewise.
    	* ctf-create.c (ctf_add_type): Likewise.

Pushed on your behalf.
Salud!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] libctf: eschew %zi format specifier
  2019-06-05 12:38 [PATCH] libctf: eschew %zi format specifier Nick Alcock
  2019-06-05 13:13 ` Jose E. Marchesi
@ 2019-06-05 13:47 ` Tom Tromey
  2019-06-05 17:06   ` Nick Alcock
  1 sibling, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2019-06-05 13:47 UTC (permalink / raw)
  To: Nick Alcock; +Cc: binutils, jose.marches, tom.tromey

>>>>> "Nick" == Nick Alcock <nick.alcock@oracle.com> writes:

Nick> Too many platforms don't support it, and we can always safely use %lu or
Nick> %li anyway, because the only uses are in debugging output.

Thanks for doing this.  I can confirm it fixes the warnings I sent in
that note.  It turns out there were more, because I'd only reported the
ones that occurred in a file with errors.  Full log appended.

The implicit function declaration one looks maybe bad.

Tom

make  all-am
make[1]: Entering directory '/home/tromey/gdb/build-mingw/libctf'
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-archive.o -MD -MP -MF .deps/ctf-archive.Tpo -c -o ctf-archive.o ../../binutils-gdb/libctf/ctf-archive.c
../../binutils-gdb/libctf/ctf-archive.c: In function 'arc_mmap_header':
../../binutils-gdb/libctf/ctf-archive.c:684:35: warning: unused parameter 'fd' [-Wunused-parameter]
 static void *arc_mmap_header (int fd, size_t headersz)
                               ~~~~^~
mv -f .deps/ctf-archive.Tpo .deps/ctf-archive.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-dump.o -MD -MP -MF .deps/ctf-dump.Tpo -c -o ctf-dump.o ../../binutils-gdb/libctf/ctf-dump.c
../../binutils-gdb/libctf/ctf-dump.c: In function 'ctf_dump_format_type':
../../binutils-gdb/libctf/ctf-dump.c:124:42: warning: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'ssize_t' {aka 'int'} [-Wformat=]
    if (asprintf (&bit, " %lx: %s (size %lx)", id, buf[0] == '\0' ?
                                        ~~^
                                        %x
    "(nameless)" : buf, ctf_type_size (fp, id)) < 0)
                        ~~~~~~~~~~~~~~~~~~~~~~
../../binutils-gdb/libctf/ctf-dump.c: In function 'ctf_dump_objts':
../../binutils-gdb/libctf/ctf-dump.c:214:27: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
    if (asprintf (&str, "%lx -> ", i) < 0)
                         ~~^       ~
                         %x
../../binutils-gdb/libctf/ctf-dump.c:219:31: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
    if (asprintf (&str, "%s (%lx) -> ", sym_name, i) < 0)
                             ~~^                  ~
                             %x
../../binutils-gdb/libctf/ctf-dump.c: In function 'ctf_dump_funcs':
../../binutils-gdb/libctf/ctf-dump.c:282:27: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
    if (asprintf (&bit, "%lx ", i) < 0)
                         ~~^    ~
                         %x
../../binutils-gdb/libctf/ctf-dump.c:287:31: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
    if (asprintf (&bit, "%s (%lx) ", sym_name, i) < 0)
                             ~~^               ~
                             %x
../../binutils-gdb/libctf/ctf-dump.c: In function 'ctf_dump_member':
../../binutils-gdb/libctf/ctf-dump.c:370:79: warning: format '%lx' expects argument of type 'long unsigned int', but argument 8 has type 'ssize_t' {aka 'int'} [-Wformat=]
   if (asprintf (&bit, "    [0x%lx] (ID 0x%lx) (kind %i) %s %s (aligned at 0x%lx",
                                                                             ~~^
                                                                             %x
../../binutils-gdb/libctf/ctf-dump.c:372:3:
   ctf_type_align (state->cdm_fp, id)) < 0)
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                           
../../binutils-gdb/libctf/ctf-dump.c: In function 'ctf_dump_str':
../../binutils-gdb/libctf/ctf-dump.c:443:30: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Wformat=]
       if (asprintf (&str, "%lx: %s", s - fp->ctf_str[CTF_STRTAB_0].cts_strs,
                            ~~^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                            %x
mv -f .deps/ctf-dump.Tpo .deps/ctf-dump.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-create.o -MD -MP -MF .deps/ctf-create.Tpo -c -o ctf-create.o ../../binutils-gdb/libctf/ctf-create.c
mv -f .deps/ctf-create.Tpo .deps/ctf-create.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-decl.o -MD -MP -MF .deps/ctf-decl.Tpo -c -o ctf-decl.o ../../binutils-gdb/libctf/ctf-decl.c
mv -f .deps/ctf-decl.Tpo .deps/ctf-decl.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-error.o -MD -MP -MF .deps/ctf-error.Tpo -c -o ctf-error.o ../../binutils-gdb/libctf/ctf-error.c
mv -f .deps/ctf-error.Tpo .deps/ctf-error.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-hash.o -MD -MP -MF .deps/ctf-hash.Tpo -c -o ctf-hash.o ../../binutils-gdb/libctf/ctf-hash.c
mv -f .deps/ctf-hash.Tpo .deps/ctf-hash.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-labels.o -MD -MP -MF .deps/ctf-labels.Tpo -c -o ctf-labels.o ../../binutils-gdb/libctf/ctf-labels.c
mv -f .deps/ctf-labels.Tpo .deps/ctf-labels.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-lookup.o -MD -MP -MF .deps/ctf-lookup.Tpo -c -o ctf-lookup.o ../../binutils-gdb/libctf/ctf-lookup.c
../../binutils-gdb/libctf/ctf-lookup.c: In function 'ctf_lookup_by_name':
../../binutils-gdb/libctf/ctf-lookup.c:156:29: warning: implicit declaration of function 'strndup' [-Wimplicit-function-declaration]
     fp->ctf_tmp_typeslice = strndup (p, (size_t) (q - p));
                             ^~~~~~~
../../binutils-gdb/libctf/ctf-lookup.c:156:29: warning: incompatible implicit declaration of built-in function 'strndup'
mv -f .deps/ctf-lookup.Tpo .deps/ctf-lookup.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-open.o -MD -MP -MF .deps/ctf-open.Tpo -c -o ctf-open.o ../../binutils-gdb/libctf/ctf-open.c
mv -f .deps/ctf-open.Tpo .deps/ctf-open.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-open-bfd.o -MD -MP -MF .deps/ctf-open-bfd.Tpo -c -o ctf-open-bfd.o ../../binutils-gdb/libctf/ctf-open-bfd.c
mv -f .deps/ctf-open-bfd.Tpo .deps/ctf-open-bfd.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-subr.o -MD -MP -MF .deps/ctf-subr.Tpo -c -o ctf-subr.o ../../binutils-gdb/libctf/ctf-subr.c
../../binutils-gdb/libctf/ctf-subr.c: In function 'ctf_data_protect':
../../binutils-gdb/libctf/ctf-subr.c:109:25: warning: unused parameter 'buf' [-Wunused-parameter]
 ctf_data_protect (void *buf, size_t size)
                   ~~~~~~^~~
../../binutils-gdb/libctf/ctf-subr.c:109:37: warning: unused parameter 'size' [-Wunused-parameter]
 ctf_data_protect (void *buf, size_t size)
                              ~~~~~~~^~~~
mv -f .deps/ctf-subr.Tpo .deps/ctf-subr.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-types.o -MD -MP -MF .deps/ctf-types.Tpo -c -o ctf-types.o ../../binutils-gdb/libctf/ctf-types.c
mv -f .deps/ctf-types.Tpo .deps/ctf-types.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-util.o -MD -MP -MF .deps/ctf-util.Tpo -c -o ctf-util.o ../../binutils-gdb/libctf/ctf-util.c
mv -f .deps/ctf-util.Tpo .deps/ctf-util.Po
i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-gdb/libctf  -D_GNU_SOURCE -I../../binutils-gdb/libctf -I../../binutils-gdb/libctf/../include -I../../binutils-gdb/libctf/../bfd -I../bfd  -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long  -I../../binutils-gdb/libctf/../zlib -g -O2 -D__USE_MINGW_ACCESS -MT ctf-qsort_r.o -MD -MP -MF .deps/ctf-qsort_r.Tpo -c -o ctf-qsort_r.o ../../binutils-gdb/libctf/ctf-qsort_r.c
mv -f .deps/ctf-qsort_r.Tpo .deps/ctf-qsort_r.Po
rm -f libctf.a
i686-w64-mingw32-ar cru libctf.a ctf-archive.o ctf-dump.o ctf-create.o ctf-decl.o ctf-error.o ctf-hash.o ctf-labels.o ctf-lookup.o ctf-open.o ctf-open-bfd.o ctf-subr.o ctf-types.o ctf-util.o ctf-qsort_r.o 
i686-w64-mingw32-ranlib libctf.a
make[1]: Leaving directory '/home/tromey/gdb/build-mingw/libctf'

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] libctf: eschew %zi format specifier
  2019-06-05 13:47 ` Tom Tromey
@ 2019-06-05 17:06   ` Nick Alcock
  2019-06-05 18:03     ` Tom Tromey
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Alcock @ 2019-06-05 17:06 UTC (permalink / raw)
  To: Tom Tromey; +Cc: binutils, jose.marches, tom.tromey

On 5 Jun 2019, Tom Tromey outgrape:

>>>>>> "Nick" == Nick Alcock <nick.alcock@oracle.com> writes:
>
> Nick> Too many platforms don't support it, and we can always safely use %lu or
> Nick> %li anyway, because the only uses are in debugging output.
>
> Thanks for doing this.  I can confirm it fixes the warnings I sent in
> that note.  It turns out there were more, because I'd only reported the
> ones that occurred in a file with errors.  Full log appended.

I searched for %z uses. I was hoping you might report any other stuff
that happened. :)

I'll squash these.

> The implicit function declaration one looks maybe bad.

No strndup()?! Can't we even rely on POSIX.1-2001? It's old enough to
vote! (I guess I'll have to AC_LIBOBJ a replacement in.)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] libctf: eschew %zi format specifier
  2019-06-05 17:06   ` Nick Alcock
@ 2019-06-05 18:03     ` Tom Tromey
  2019-06-06 11:55       ` Nick Alcock
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2019-06-05 18:03 UTC (permalink / raw)
  To: Nick Alcock; +Cc: Tom Tromey, binutils, jose.marches, tom.tromey

>>>>> "Nick" == Nick Alcock <nick.alcock@oracle.com> writes:

Nick> No strndup()?! Can't we even rely on POSIX.1-2001? It's old enough to
Nick> vote! (I guess I'll have to AC_LIBOBJ a replacement in.)

libiberty has xstrndup.  Maybe there's a reason libctf can't use
libiberty?

Soon I hope to move gnulib to top-level.  That would make some of this
stuff simpler.  However, it may be tricky, depending on your exact
needs.

Anyway I looked through the mingw string.h and, yeah, no strndup.

    $ pwd
    /usr/i686-w64-mingw32/sys-root/mingw/include
    $ grep -R strndup .
    $ rpm -qf string.h
    mingw32-headers-5.0.4-2.fc29.noarch

Tom

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] libctf: eschew %zi format specifier
  2019-06-05 18:03     ` Tom Tromey
@ 2019-06-06 11:55       ` Nick Alcock
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Alcock @ 2019-06-06 11:55 UTC (permalink / raw)
  To: Tom Tromey; +Cc: binutils, jose.marches, tom.tromey

On 5 Jun 2019, Tom Tromey stated:

>>>>>> "Nick" == Nick Alcock <nick.alcock@oracle.com> writes:
>
> Nick> No strndup()?! Can't we even rely on POSIX.1-2001? It's old enough to
> Nick> vote! (I guess I'll have to AC_LIBOBJ a replacement in.)
>
> libiberty has xstrndup.  Maybe there's a reason libctf can't use
> libiberty?

It is using it already (for the hashtab, for starters), and I forgot
that xstrndup existed. That makes things *much* simpler.

I'll submit a patch to switch to that shortly, as well as fixing the
other warnings you noted. :)

-- 
NULL && (void)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-06 11:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-05 12:38 [PATCH] libctf: eschew %zi format specifier Nick Alcock
2019-06-05 13:13 ` Jose E. Marchesi
2019-06-05 13:47 ` Tom Tromey
2019-06-05 17:06   ` Nick Alcock
2019-06-05 18:03     ` Tom Tromey
2019-06-06 11:55       ` Nick Alcock

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).