bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PATCH] declare free() in lib/free.c
@ 2021-09-08 11:42 Lucy Phipps
  2021-09-08 14:59 ` Bruno Haible
  0 siblings, 1 reply; 5+ messages in thread
From: Lucy Phipps @ 2021-09-08 11:42 UTC (permalink / raw)
  To: Gnulib bugs, Paul Eggert

avoids an implicit declaration warning
---
lib/free.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/free.c b/lib/free.c
index 780f03dd1..804640c2e 100644
--- a/lib/free.c
+++ b/lib/free.c
@@ -27,9 +27,11 @@

 # include <errno.h>

+# undef free
+void free (void *);
+
 void
 rpl_free (void *p)
-# undef free
 {
 # if defined __GNUC__ && !defined __clang__
   /* An invalid GCC optimization


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

* Re: [PATCH] declare free() in lib/free.c
  2021-09-08 11:42 [PATCH] declare free() in lib/free.c Lucy Phipps
@ 2021-09-08 14:59 ` Bruno Haible
  2021-09-10 10:23   ` Simon Josefsson via Gnulib discussion list
  0 siblings, 1 reply; 5+ messages in thread
From: Bruno Haible @ 2021-09-08 14:59 UTC (permalink / raw)
  To: bug-gnulib, Paul Eggert; +Cc: Lucy Phipps

Hi,

> @@ -27,9 +27,11 @@
> 
>  # include <errno.h>
> 
> +# undef free
> +void free (void *);
> +
>  void
>  rpl_free (void *p)
> -# undef free
>  {
>  # if defined __GNUC__ && !defined __clang__
>    /* An invalid GCC optimization
> 
> 

Moving the '#undef' line up-front is generally not right: it makes it
impossible for a library, say 'libfoo', to be namespace-clean by defining
  #define free libfoo_free

If there is an implicit declaration warning, it should be fixed by
including the specification header for that function. The specification
header for the 'free' function is <stdlib.h> — which is already included
at the top of free.c.

What exactly is the problem that you were seeing? (Commands to reproduce,
and compiler output, please.)

Bruno





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

* Re: [PATCH] declare free() in lib/free.c
  2021-09-08 14:59 ` Bruno Haible
@ 2021-09-10 10:23   ` Simon Josefsson via Gnulib discussion list
  2021-09-10 11:17     ` Lucy Phipps
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Josefsson via Gnulib discussion list @ 2021-09-10 10:23 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib, Paul Eggert, Lucy Phipps

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

Bruno Haible <bruno@clisp.org> writes:

> What exactly is the problem that you were seeing? (Commands to reproduce,
> and compiler output, please.)

I haven't had time to debug it, but since a few days libidn fails to
build with a reference to rpl_free, that looks related to this thread
and the recent gnulib changes for the free module:

https://oss-fuzz-build-logs.storage.googleapis.com/log-002189ee-3c98-45b8-9bde-3bfb20317e9a.txt

/Simon

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]

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

* Re: [PATCH] declare free() in lib/free.c
  2021-09-10 10:23   ` Simon Josefsson via Gnulib discussion list
@ 2021-09-10 11:17     ` Lucy Phipps
  2021-09-10 11:24       ` Lucy Phipps
  0 siblings, 1 reply; 5+ messages in thread
From: Lucy Phipps @ 2021-09-10 11:17 UTC (permalink / raw)
  To: Simon Josefsson; +Cc: Gnulib bugs, Paul Eggert, Bruno Haible

[-- Attachment #1: Type: text/plain, Size: 691 bytes --]

Simon, this patch wasn't applied to the gnulib repo, however
https://lists.gnu.org/r/bug-gnulib/2021-09/msg00032.html was. Sorry for the
confusion.

On Fri, 10 Sep 2021, 11:24 Simon Josefsson, <simon@josefsson.org> wrote:

> Bruno Haible <bruno@clisp.org> writes:
>
> > What exactly is the problem that you were seeing? (Commands to reproduce,
> > and compiler output, please.)
>
> I haven't had time to debug it, but since a few days libidn fails to
> build with a reference to rpl_free, that looks related to this thread
> and the recent gnulib changes for the free module:
>
>
> https://oss-fuzz-build-logs.storage.googleapis.com/log-002189ee-3c98-45b8-9bde-3bfb20317e9a.txt
>
> /Simon
>

[-- Attachment #2: Type: text/html, Size: 1359 bytes --]

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

* Re: [PATCH] declare free() in lib/free.c
  2021-09-10 11:17     ` Lucy Phipps
@ 2021-09-10 11:24       ` Lucy Phipps
  0 siblings, 0 replies; 5+ messages in thread
From: Lucy Phipps @ 2021-09-10 11:24 UTC (permalink / raw)
  To: Simon Josefsson; +Cc: Gnulib bugs, Paul Eggert, Bruno Haible

[-- Attachment #1: Type: text/plain, Size: 887 bytes --]

and that patch was a follow up to
https://lists.gnu.org/r/bug-gnulib/2021-09/msg00024.html

On Fri, 10 Sep 2021, 12:17 Lucy Phipps, <landfillbaby69@gmail.com> wrote:

> Simon, this patch wasn't applied to the gnulib repo, however
> https://lists.gnu.org/r/bug-gnulib/2021-09/msg00032.html was. Sorry for
> the confusion.
>
> On Fri, 10 Sep 2021, 11:24 Simon Josefsson, <simon@josefsson.org> wrote:
>
>> Bruno Haible <bruno@clisp.org> writes:
>>
>> > What exactly is the problem that you were seeing? (Commands to
>> reproduce,
>> > and compiler output, please.)
>>
>> I haven't had time to debug it, but since a few days libidn fails to
>> build with a reference to rpl_free, that looks related to this thread
>> and the recent gnulib changes for the free module:
>>
>>
>> https://oss-fuzz-build-logs.storage.googleapis.com/log-002189ee-3c98-45b8-9bde-3bfb20317e9a.txt
>>
>> /Simon
>>
>

[-- Attachment #2: Type: text/html, Size: 2040 bytes --]

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

end of thread, other threads:[~2021-09-10 13:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 11:42 [PATCH] declare free() in lib/free.c Lucy Phipps
2021-09-08 14:59 ` Bruno Haible
2021-09-10 10:23   ` Simon Josefsson via Gnulib discussion list
2021-09-10 11:17     ` Lucy Phipps
2021-09-10 11:24       ` Lucy Phipps

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