Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] norm: fix build with gcc 7.x
@ 2017-08-20 13:52 Thomas Petazzoni
  2017-08-20 13:55 ` Thomas Petazzoni
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-08-20 13:52 UTC (permalink / raw)
  To: buildroot

This commit adds a patch to the norm package that fixes the build with
gcc 7.x. Many thanks to Romain Naour for pointing out the solution to
this C++ build problem.

Fixes:

  http://autobuild.buildroot.net/results/c79dc84cdc34d62199099eb4438b1aed3e7459bb/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/norm/0003-fix-const-qualifier-gcc7.patch | 44 ++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 package/norm/0003-fix-const-qualifier-gcc7.patch

diff --git a/package/norm/0003-fix-const-qualifier-gcc7.patch b/package/norm/0003-fix-const-qualifier-gcc7.patch
new file mode 100644
index 0000000..3d9671f
--- /dev/null
+++ b/package/norm/0003-fix-const-qualifier-gcc7.patch
@@ -0,0 +1,44 @@
+protolib: remove const qualifiers in ProtoSortedTreeTemplate
+
+The methods PeekPrevItem() and PeekNextItem() in
+ProtoSortedTreeTemplate were using a const qualifier, but not the
+corresponding methods in ProtoSortedTree, causing a build failure with
+gcc 7.x:
+
+norm-1.5r6/protolib/include/protoTree.h: In member function 'ITEM_TYPE* ProtoSortedTreeTemplate<ITEM_TYPE>::Iterator::PeekPrevItem() const':
+norm-1.5r6/protolib/include/protoTree.h:652:93: error: no matching function for call to 'ProtoSortedTreeTemplate<ITEM_TYPE>::Iterator::PeekPrevItem() const'
+                     {return static_cast<ITEM_TYPE*>(ProtoSortedTree::Iterator::PeekPrevItem());}
+                                                                                             ^
+norm-1.5r6/protolib/include/protoTree.h:565:23: note: candidate: ProtoSortedTree::Item* ProtoSortedTree::Iterator::PeekPrevItem() <near match>
+                 Item* PeekPrevItem()
+                       ^~~~~~~~~~~~
+
+Since the same methods in ProtoTreeTemplate don't have the const
+qualifier, we take the simple solution of dropping such qualifiers
+from ProtoSortedTreeTemplate as well, which fixes the build of norm
+with gcc 7.x.
+
+Many thanks to Romain Naour <romain.naour@gmail.com> for pointing out
+the solution.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/protolib/include/protoTree.h
+===================================================================
+--- a/protolib/include/protoTree.h
++++ b/protolib/include/protoTree.h
+@@ -648,12 +648,12 @@
+                 
+                 ITEM_TYPE* GetPrevItem()
+                     {return static_cast<ITEM_TYPE*>(ProtoSortedTree::Iterator::GetPrevItem());}
+-                ITEM_TYPE* PeekPrevItem() const
++                ITEM_TYPE* PeekPrevItem()
+                     {return static_cast<ITEM_TYPE*>(ProtoSortedTree::Iterator::PeekPrevItem());}
+                 
+                 ITEM_TYPE* GetNextItem()
+                     {return static_cast<ITEM_TYPE*>(ProtoSortedTree::Iterator::GetNextItem());}
+-                ITEM_TYPE* PeekNextItem() const
++                ITEM_TYPE* PeekNextItem()
+                     {return static_cast<ITEM_TYPE*>(ProtoSortedTree::Iterator::PeekNextItem());}
+ 
+         };  // end class ProtoSortedTreeTemplate::Iterator
-- 
2.9.4

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

* [Buildroot] [PATCH] norm: fix build with gcc 7.x
  2017-08-20 13:52 [Buildroot] [PATCH] norm: fix build with gcc 7.x Thomas Petazzoni
@ 2017-08-20 13:55 ` Thomas Petazzoni
  2017-08-20 14:01 ` Romain Naour
  2017-08-21 21:23 ` Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-08-20 13:55 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 20 Aug 2017 15:52:34 +0200, Thomas Petazzoni wrote:

>  package/norm/0003-fix-const-qualifier-gcc7.patch | 44 ++++++++++++++++++++++++

This patch has been submitted upstream to
https://publists.nrl.navy.mil/pipermail/norm-dev/, but the mailing list
archives have not been updated yet.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] norm: fix build with gcc 7.x
  2017-08-20 13:52 [Buildroot] [PATCH] norm: fix build with gcc 7.x Thomas Petazzoni
  2017-08-20 13:55 ` Thomas Petazzoni
@ 2017-08-20 14:01 ` Romain Naour
  2017-08-21 21:23 ` Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Romain Naour @ 2017-08-20 14:01 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Le 20/08/2017 ? 15:52, Thomas Petazzoni a ?crit :
> This commit adds a patch to the norm package that fixes the build with
> gcc 7.x. Many thanks to Romain Naour for pointing out the solution to
> this C++ build problem.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/c79dc84cdc34d62199099eb4438b1aed3e7459bb/

Reviewed-by: Romain Naour <romain.naour@gmail.com>

Best regards,
Romain

> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  package/norm/0003-fix-const-qualifier-gcc7.patch | 44 ++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
>  create mode 100644 package/norm/0003-fix-const-qualifier-gcc7.patch
> 
> diff --git a/package/norm/0003-fix-const-qualifier-gcc7.patch b/package/norm/0003-fix-const-qualifier-gcc7.patch
> new file mode 100644
> index 0000000..3d9671f
> --- /dev/null
> +++ b/package/norm/0003-fix-const-qualifier-gcc7.patch
> @@ -0,0 +1,44 @@
> +protolib: remove const qualifiers in ProtoSortedTreeTemplate
> +
> +The methods PeekPrevItem() and PeekNextItem() in
> +ProtoSortedTreeTemplate were using a const qualifier, but not the
> +corresponding methods in ProtoSortedTree, causing a build failure with
> +gcc 7.x:
> +
> +norm-1.5r6/protolib/include/protoTree.h: In member function 'ITEM_TYPE* ProtoSortedTreeTemplate<ITEM_TYPE>::Iterator::PeekPrevItem() const':
> +norm-1.5r6/protolib/include/protoTree.h:652:93: error: no matching function for call to 'ProtoSortedTreeTemplate<ITEM_TYPE>::Iterator::PeekPrevItem() const'
> +                     {return static_cast<ITEM_TYPE*>(ProtoSortedTree::Iterator::PeekPrevItem());}
> +                                                                                             ^
> +norm-1.5r6/protolib/include/protoTree.h:565:23: note: candidate: ProtoSortedTree::Item* ProtoSortedTree::Iterator::PeekPrevItem() <near match>
> +                 Item* PeekPrevItem()
> +                       ^~~~~~~~~~~~
> +
> +Since the same methods in ProtoTreeTemplate don't have the const
> +qualifier, we take the simple solution of dropping such qualifiers
> +from ProtoSortedTreeTemplate as well, which fixes the build of norm
> +with gcc 7.x.
> +
> +Many thanks to Romain Naour <romain.naour@gmail.com> for pointing out
> +the solution.
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +
> +Index: b/protolib/include/protoTree.h
> +===================================================================
> +--- a/protolib/include/protoTree.h
> ++++ b/protolib/include/protoTree.h
> +@@ -648,12 +648,12 @@
> +                 
> +                 ITEM_TYPE* GetPrevItem()
> +                     {return static_cast<ITEM_TYPE*>(ProtoSortedTree::Iterator::GetPrevItem());}
> +-                ITEM_TYPE* PeekPrevItem() const
> ++                ITEM_TYPE* PeekPrevItem()
> +                     {return static_cast<ITEM_TYPE*>(ProtoSortedTree::Iterator::PeekPrevItem());}
> +                 
> +                 ITEM_TYPE* GetNextItem()
> +                     {return static_cast<ITEM_TYPE*>(ProtoSortedTree::Iterator::GetNextItem());}
> +-                ITEM_TYPE* PeekNextItem() const
> ++                ITEM_TYPE* PeekNextItem()
> +                     {return static_cast<ITEM_TYPE*>(ProtoSortedTree::Iterator::PeekNextItem());}
> + 
> +         };  // end class ProtoSortedTreeTemplate::Iterator
> 

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

* [Buildroot] [PATCH] norm: fix build with gcc 7.x
  2017-08-20 13:52 [Buildroot] [PATCH] norm: fix build with gcc 7.x Thomas Petazzoni
  2017-08-20 13:55 ` Thomas Petazzoni
  2017-08-20 14:01 ` Romain Naour
@ 2017-08-21 21:23 ` Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-08-21 21:23 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 20 Aug 2017 15:52:34 +0200, Thomas Petazzoni wrote:
> This commit adds a patch to the norm package that fixes the build with
> gcc 7.x. Many thanks to Romain Naour for pointing out the solution to
> this C++ build problem.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/c79dc84cdc34d62199099eb4438b1aed3e7459bb/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  package/norm/0003-fix-const-qualifier-gcc7.patch | 44 ++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
>  create mode 100644 package/norm/0003-fix-const-qualifier-gcc7.patch

Applied to master, after adding details regarding the upstream status
of the patch (it has been accepted).

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2017-08-21 21:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-20 13:52 [Buildroot] [PATCH] norm: fix build with gcc 7.x Thomas Petazzoni
2017-08-20 13:55 ` Thomas Petazzoni
2017-08-20 14:01 ` Romain Naour
2017-08-21 21:23 ` Thomas Petazzoni

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