public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* Patch: fix warning
@ 2011-01-18  1:47 Torsten Rupp
  2011-02-10 13:46 ` Jasper Lievisse Adriaanse
  2011-02-11 17:28 ` Anthony Green
  0 siblings, 2 replies; 5+ messages in thread
From: Torsten Rupp @ 2011-01-18  1:47 UTC (permalink / raw)
  To: libffi-discuss

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

Dear developers,

the file debug.c may produce a warning of missing prototypes when not 
compiled with FFI_DEBUG defined. The attached patch wrap the 
functions in debug.c with a #ifdef FFI_DEBUG to fix this warning.

Torsten

-- 
aicas GmbH
〒300-1525 * 茨城県取手市桜が丘4-27-3 * Japan
http://www.aicas.com * 電話番号/FAX:+81-297-82-3908

USt-Id: DE216375633, Handelsregister HRB 109481, AG Mannheim
Geschäftsführer: Dr. James J. Hunt

[-- Attachment #2: libffi_debug_fix_warnings.patch --]
[-- Type: text/x-diff, Size: 387 bytes --]

--- libffi-3.0.9/src/debug.c	2009-12-30 00:22:26.000000000 +0900
+++ libffi-3.0.9-new/src/debug.c	2011-01-18 10:40:50.009145497 +0900
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#ifdef FFI_DEBUG
 /* General debugging routines */
 
 void ffi_stop_here(void)
@@ -57,3 +58,4 @@
   FFI_ASSERT_AT(a->type != FFI_TYPE_STRUCT || a->elements != NULL, file, line);
 
 }
+#endif

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

* Re: Patch: fix warning
  2011-01-18  1:47 Patch: fix warning Torsten Rupp
@ 2011-02-10 13:46 ` Jasper Lievisse Adriaanse
  2011-02-11  6:13   ` Torsten Rupp
  2011-02-11 17:28 ` Anthony Green
  1 sibling, 1 reply; 5+ messages in thread
From: Jasper Lievisse Adriaanse @ 2011-02-10 13:46 UTC (permalink / raw)
  To: Torsten Rupp; +Cc: libffi-discuss

On Tue, Jan 18, 2011 at 10:43:32AM +0900, Torsten Rupp wrote:
> Dear developers,
> 
> the file debug.c may produce a warning of missing prototypes when not 
> compiled with FFI_DEBUG defined. The attached patch wrap the 
> functions in debug.c with a #ifdef FFI_DEBUG to fix this warning.
> 
> Torsten
Hi,

I think the #ifdef line should be the very first line in the file, even before
including any other files.
 
> -- 
> aicas GmbH
> ???300-1525 * ???????????????????????????4-27-3 * Japan
> http://www.aicas.com * ????????????/FAX???+81-297-82-3908
> 
> USt-Id: DE216375633, Handelsregister HRB 109481, AG Mannheim
> Gesch??ftsf??hrer: Dr. James J. Hunt

> --- libffi-3.0.9/src/debug.c	2009-12-30 00:22:26.000000000 +0900
> +++ libffi-3.0.9-new/src/debug.c	2011-01-18 10:40:50.009145497 +0900
> @@ -27,6 +27,7 @@
>  #include <stdlib.h>
>  #include <stdio.h>
>  
> +#ifdef FFI_DEBUG
>  /* General debugging routines */
>  
>  void ffi_stop_here(void)
> @@ -57,3 +58,4 @@
>    FFI_ASSERT_AT(a->type != FFI_TYPE_STRUCT || a->elements != NULL, file, line);
>  
>  }
> +#endif


-- 
Cheers,
Jasper

"Capable, generous men do not create victims, they nurture them."

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

* Re: Patch: fix warning
  2011-02-10 13:46 ` Jasper Lievisse Adriaanse
@ 2011-02-11  6:13   ` Torsten Rupp
  0 siblings, 0 replies; 5+ messages in thread
From: Torsten Rupp @ 2011-02-11  6:13 UTC (permalink / raw)
  To: Jasper Lievisse Adriaanse; +Cc: libffi-discuss

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

Dear Jasper,

> I think the #ifdef line should be the very first line in the file,
> even before including any other files.

OK. Please find attached a modified patch.

Torsten

-- 
aicas GmbH
〒300-1525 * 茨城県取手市桜が丘4-27-3 * Japan
http://www.aicas.com * 電話番号/FAX:+81-297-82-3908

USt-Id: DE216375633, Handelsregister HRB 109481, AG Mannheim
Geschäftsführer: Dr. James J. Hunt

[-- Attachment #2: libffi-debug.patch --]
[-- Type: text/x-diff, Size: 421 bytes --]

--- libffi-3.0.9/src/debug.c	2009-12-30 00:22:26.000000000 +0900
+++ libffi-3.0.9-new/src/debug.c	2011-02-11 13:32:50.374940616 +0900
@@ -1,3 +1,4 @@
+#ifdef FFI_DEBUG
 /* -----------------------------------------------------------------------
    debug.c - Copyright (c) 1996 Red Hat, Inc.
 
@@ -57,3 +58,4 @@
   FFI_ASSERT_AT(a->type != FFI_TYPE_STRUCT || a->elements != NULL, file, line);
 
 }
+#endif /* FFI_DEBUG */

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

* Re: Patch: fix warning
  2011-01-18  1:47 Patch: fix warning Torsten Rupp
  2011-02-10 13:46 ` Jasper Lievisse Adriaanse
@ 2011-02-11 17:28 ` Anthony Green
  2011-02-14  2:24   ` Torsten Rupp
  1 sibling, 1 reply; 5+ messages in thread
From: Anthony Green @ 2011-02-11 17:28 UTC (permalink / raw)
  To: Torsten Rupp; +Cc: libffi-discuss

Torsten Rupp <torsten.rupp@aicas.com> writes:

> Dear developers,
>
> the file debug.c may produce a warning of missing prototypes when not 
> compiled with FFI_DEBUG defined. The attached patch wrap the 
> functions in debug.c with a #ifdef FFI_DEBUG to fix this warning.

I just modified Makefile.am to not build debug.c unless you've
configured with --enable-debug.  Technically this alters the ABI, so
I'll have to tweak the libtool version.

AG

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

* Re: Patch: fix warning
  2011-02-11 17:28 ` Anthony Green
@ 2011-02-14  2:24   ` Torsten Rupp
  0 siblings, 0 replies; 5+ messages in thread
From: Torsten Rupp @ 2011-02-14  2:24 UTC (permalink / raw)
  To: Anthony Green; +Cc: libffi-discuss

Dear Anthony,


> I just modified Makefile.am to not build debug.c unless you've
> configured with --enable-debug.  Technically this alters the ABI,
> so I'll have to tweak the libtool version.

I agree. Removing the debug functions completely would be an option, 
too.

Torsten

-- 
aicas GmbH
〒300-1525 * 茨城県取手市桜が丘4-27-3 * Japan
http://www.aicas.com * 電話番号/FAX:+81-297-82-3908

USt-Id: DE216375633, Handelsregister HRB 109481, AG Mannheim
Geschäftsführer: Dr. James J. Hunt

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

end of thread, other threads:[~2011-02-14  2:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-18  1:47 Patch: fix warning Torsten Rupp
2011-02-10 13:46 ` Jasper Lievisse Adriaanse
2011-02-11  6:13   ` Torsten Rupp
2011-02-11 17:28 ` Anthony Green
2011-02-14  2:24   ` Torsten Rupp

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