public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev][PATCH v1 ] sys-fs/hfsplusutils with gcc-5: blockiter.c:148:8: error: redefinition of blockiter_curr #580620
@ 2016-04-22  7:57 Leno Hou
  2016-04-23  6:39 ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Leno Hou @ 2016-04-22  7:57 UTC (permalink / raw
  To: alex_y_xu, gentoo-dev, vapier; +Cc: Leno Hou

Signed-off-by: Leno Hou <lenohou@gmail.com>
---
 .../files/hfsplusutils-1.0.4-gcc5.patch            | 98 ++++++++++++++++++++++
 sys-fs/hfsplusutils/hfsplusutils-1.0.4-r1.ebuild   |  1 +
 2 files changed, 99 insertions(+)
 create mode 100644 sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-gcc5.patch

diff --git a/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-gcc5.patch b/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-gcc5.patch
new file mode 100644
index 0000000..3dacd57
--- /dev/null
+++ b/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-gcc5.patch
@@ -0,0 +1,98 @@
+--- libhfsp/src/blockiter.h.orig	2016-04-15 16:32:04.548299500 +0000
++++ libhfsp/src/blockiter.h	2016-04-15 16:32:24.920515955 +0000
+@@ -52,9 +52,4 @@
+ extern int blockiter_skip(blockiter *b, UInt32 skip);
+ 
+ /* return current block */
+-extern inline UInt32 blockiter_curr(blockiter *b)
+-{
+-    return b->e->start_block + b->block;
+-}
+-
+-
++extern inline UInt32 blockiter_curr(blockiter *b);
+--- libhfsp/src/libhfsp.h.orig	2016-04-15 16:32:45.888738808 +0000
++++ libhfsp/src/libhfsp.h	2016-04-15 16:33:12.809024783 +0000
+@@ -90,15 +90,7 @@
+ 
+     
+ /** helper function to create those Apple 4 byte Signatures */
+-extern inline UInt32 sig(char c0, char c1, char c2, char c3)
+-{
+-    UInt32 sig;
+-    ((char*)&sig)[0] = c0;
+-    ((char*)&sig)[1] = c1;
+-    ((char*)&sig)[2] = c2;
+-    ((char*)&sig)[3] = c3;
+-    return sig;
+-}
++extern inline UInt32 sig(char c0, char c1, char c2, char c3);
+ 
+ 
+ 
+--- libhfsp/src/volume.h.orig	2016-04-15 16:34:29.641839177 +0000
++++ libhfsp/src/volume.h	2016-04-15 16:35:03.154194245 +0000
+@@ -75,12 +75,7 @@
+ extern void volume_create_extents_tree(volume* vol);
+ 
+ /* accessor for entends btree, is created on demand */
+-extern inline btree* volume_get_extents_tree(volume* vol) 
+-{
+-    if (!vol->extents)
+-	volume_create_extents_tree(vol);
+-    return vol->extents;
+-}
++extern inline btree* volume_get_extents_tree(volume* vol);
+ 
+ /* return new Id for files/folder and check for overflow.
+  *
+--- src/dstring.h.orig	2016-04-15 16:38:14.404216390 +0000
++++ src/dstring.h	2016-04-15 16:38:45.344543346 +0000
+@@ -42,13 +42,6 @@
+ extern void	dstring_shrink(dstring *, size_t);
+ extern void	dstring_free(dstring *);
+ 
+-extern inline char	*dstring_string(dstring *string)
+-{
+-    return string->str;
+-}
+-
+-extern inline int	dstring_length(dstring *string)
+-{
+-    return string->len;
+-}  
++extern inline char	*dstring_string(dstring *string);
++extern inline int	dstring_length(dstring *string);
+ 
+--- src/dlist.h.orig	2016-04-15 16:39:16.336870099 +0000
++++ src/dlist.h	2016-04-15 16:39:55.697284793 +0000
+@@ -36,14 +36,5 @@
+ extern int	dlist_append(dlist *, const char *);
+ 
+ /* return the array of strings in a list; can dispose with free() */
+-extern inline char **dlist_array(dlist *list)
+-{
+-    return (char **) list->mem;
+-} 
+-
+-/* return the number of strings in a list */
+-extern inline int dlist_size(dlist *list)
+-{
+-  return list->eltend - (char **) list->mem;
+-}
+-
++extern inline char **dlist_array(dlist *list);
++extern inline int dlist_size(dlist *list);
+--- src/darray.h.orig	2016-04-15 16:43:23.775481365 +0000
++++ src/darray.h	2016-04-15 16:43:41.807671388 +0000
+@@ -40,9 +40,4 @@
+ extern	void	    darray_sort(darray *, int (*)(const void *, const void *));
+ 
+ /* return the array as an indexable block */
+-extern inline void *darray_array(darray *array)
+-{
+-  return (void *) array->mem;
+-}
+-
+-
++extern inline void *darray_array(darray *array);
diff --git a/sys-fs/hfsplusutils/hfsplusutils-1.0.4-r1.ebuild b/sys-fs/hfsplusutils/hfsplusutils-1.0.4-r1.ebuild
index aa6fe7c..e673c04 100644
--- a/sys-fs/hfsplusutils/hfsplusutils-1.0.4-r1.ebuild
+++ b/sys-fs/hfsplusutils/hfsplusutils-1.0.4-r1.ebuild
@@ -26,6 +26,7 @@ src_unpack() {
 	epatch "${FILESDIR}/${P}-errno.patch"
 	epatch "${FILESDIR}/${P}-gcc4.patch"
 	epatch "${FILESDIR}/${P}-string.patch"
+	epatch "${FILESDIR}/${P}-gcc5.patch"
 	#let's avoid the Makefile.cvs since isn't working for us
 	eautoreconf
 }
-- 
2.1.4



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

* Re: [gentoo-dev][PATCH v1 ] sys-fs/hfsplusutils with gcc-5: blockiter.c:148:8: error: redefinition of blockiter_curr #580620
  2016-04-22  7:57 [gentoo-dev][PATCH v1 ] sys-fs/hfsplusutils with gcc-5: blockiter.c:148:8: error: redefinition of blockiter_curr #580620 Leno Hou
@ 2016-04-23  6:39 ` Mike Frysinger
  2016-04-23 18:39   ` David Seifert
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2016-04-23  6:39 UTC (permalink / raw
  To: Leno Hou; +Cc: alex_y_xu, gentoo-dev

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

On 22 Apr 2016 03:57, Leno Hou wrote:
> +-extern inline UInt32 blockiter_curr(blockiter *b)
> +-{
> +-    return b->e->start_block + b->block;
> +-}
> +-
> +-
> ++extern inline UInt32 blockiter_curr(blockiter *b);

i don't think that's how you want to handle extern inline.
it doesn't make sense when it's declared this way as there
is no actual body for gcc to optimisitcally inline.

instead, we should go with what Ubuntu/Debian have: use the
-fgnu89-inline flag to build since those are the semantics
this code expects.  i've pushed that fix now.
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [gentoo-dev][PATCH v1 ] sys-fs/hfsplusutils with gcc-5: blockiter.c:148:8: error: redefinition of blockiter_curr #580620
  2016-04-23  6:39 ` Mike Frysinger
@ 2016-04-23 18:39   ` David Seifert
  2016-04-24  2:40     ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: David Seifert @ 2016-04-23 18:39 UTC (permalink / raw
  To: gentoo-dev

I generally prefer using -std=gnu89 instead of -fgnu89-inline, as GCC might change some C11 semantics later on. To me -std=gnu89 seems more robust.

David

> On 22 Apr 2016, at 23:39, Mike Frysinger <vapier@gentoo.org> wrote:
> 
> On 22 Apr 2016 03:57, Leno Hou wrote:
>> +-extern inline UInt32 blockiter_curr(blockiter *b)
>> +-{
>> +-    return b->e->start_block + b->block;
>> +-}
>> +-
>> +-
>> ++extern inline UInt32 blockiter_curr(blockiter *b);
> 
> i don't think that's how you want to handle extern inline.
> it doesn't make sense when it's declared this way as there
> is no actual body for gcc to optimisitcally inline.
> 
> instead, we should go with what Ubuntu/Debian have: use the
> -fgnu89-inline flag to build since those are the semantics
> this code expects.  i've pushed that fix now.
> -mike



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

* Re: [gentoo-dev][PATCH v1 ] sys-fs/hfsplusutils with gcc-5: blockiter.c:148:8: error: redefinition of blockiter_curr #580620
  2016-04-23 18:39   ` David Seifert
@ 2016-04-24  2:40     ` Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2016-04-24  2:40 UTC (permalink / raw
  To: gentoo-dev

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

On 23 Apr 2016 11:39, David Seifert wrote:

please don't top post

> I generally prefer using -std=gnu89 instead of -fgnu89-inline, as GCC might change some C11 semantics later on. To me -std=gnu89 seems more robust.

perhaps, but other than gnu-inline behavior, it seems to be fine.
if we hit another build issue, we can re-evaluate then.
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-04-24  2:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-22  7:57 [gentoo-dev][PATCH v1 ] sys-fs/hfsplusutils with gcc-5: blockiter.c:148:8: error: redefinition of blockiter_curr #580620 Leno Hou
2016-04-23  6:39 ` Mike Frysinger
2016-04-23 18:39   ` David Seifert
2016-04-24  2:40     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox