Re: Seeking help with some Clang trouble, compiling ceph

2016-10-21 Thread Willem Jan Withagen
On 21-10-2016 17:21, Dimitry Andric wrote:
> On 21 Oct 2016, at 17:07, Willem Jan Withagen 
> wrote:
>> 
>> On 21-10-2016 15:09, Willem Jan Withagen wrote:
>>> Hi,
>>> 
>>> All this Ceph stuff finally used to compile under FreeBSD. And
>>> all testss completed correctly.
>>> 
>>> But somewhere in the Ceph-tree there was a lot of template and
>>> trait code added/replaced. Problem is that this compiles under
>>> GCC, but Clang throws an error. It looks like it cannot select
>>> types of automagic conversion.
>>> 
>>> But this template/trait stuff is too much for me to wrap my
>>> head around. I'm reading up a lot, but that does not yet get me
>>> anywhere.
>>> 
>>> So I was wondering if anybody with more C++ knowledge would
>>> like to assist and give some clues as to how to fix this.
>>> 
>>> The error report is at:
>>> 
>>> http://cephdev.digiware.nl:8180/jenkins/job/ceph-freebsd/39/consoleFull
>>>
>>>
>>> 
And the ceph code can be found at:
>>> https://github.com/ceph/ceph
>> 
>> Oke, the preson responsable for the change helped to figure it
>> out, and it looks like the following diff helps
>> 
>> diff --git a/src/include/denc.h b/src/include/denc.h index
>> 59f7686..caa095b 100644 --- a/src/include/denc.h +++
>> b/src/include/denc.h @@ -722,7 +722,7 @@ struct denc_traits< 
>> template struct denc_traits< std::vector, -
>> typename std::enable_if::type> { +
>> typename std::enable_if::type> { 
>> typedef denc_traits traits;
>> 
>> enum { supported = true }; @@ -831,7 +831,7 @@ struct
>> denc_traits< template struct denc_traits< 
>> std::set, -  typename
>> std::enable_if::type> { +  typename
>> std::enable_if::type> { typedef
>> denc_traits traits;
>> 
>> enum { supported = true };
>> 
>> And the conclusion is that std::enable_if<> does not always like
>> it when the value is 'int'. the definition of supported is: 
>> struct denc_traits { enum { supported = 0 }; enum { featured =
>> false }; enum { bounded = false }; };
>> 
>> and values can range 0..2.
>> 
>> So is this a GCC liberalization, or is Clang here to picky?
> 
> It's hard to say without the full source code and a reproducer, but
> I'd say that enable_if has a bool as the first template argument,
> so it can't match an int by default.  Maybe libstdc++ has a variant
> with an int as the first template argument, but I haven't looked.

Which I understand Ceph source is a rather big monster.
OTOH it is mostly fetching with git, install-deps.sh and compiling,
but it does require quite some packages to be installed.

If you would be willing, I'd be able to give you a receipe or shell
script to just do that. Or I could give you a shell account on the
jenkins box and you go from what is there...

So what you are suggesting is looking into the include tree of gcc and
check what flavours of enable_if are there? And if it would take 'int'

--WjW



___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


Re: Seeking help with some Clang trouble, compiling ceph

2016-10-21 Thread Dimitry Andric
On 21 Oct 2016, at 17:07, Willem Jan Withagen  wrote:
> 
> On 21-10-2016 15:09, Willem Jan Withagen wrote:
>> Hi,
>> 
>> All this Ceph stuff finally used to compile under FreeBSD.
>> And all testss completed correctly.
>> 
>> But somewhere in the Ceph-tree there was a lot of template and trait
>> code added/replaced.
>> Problem is that this compiles under GCC, but Clang throws an error. It
>> looks like it cannot select types of automagic conversion.
>> 
>> But this template/trait stuff is too much for me to wrap my head around.
>> I'm reading up a lot, but that does not yet get me anywhere.
>> 
>> So I was wondering if anybody with more C++ knowledge would like to
>> assist and give some clues as to how to fix this.
>> 
>> The error report is at:
>> 
>> http://cephdev.digiware.nl:8180/jenkins/job/ceph-freebsd/39/consoleFull
>> 
>> And the ceph code can be found at:
>> https://github.com/ceph/ceph
> 
> Oke, the preson responsable for the change helped to figure it out, and
> it looks like the following diff helps
> 
> diff --git a/src/include/denc.h b/src/include/denc.h
> index 59f7686..caa095b 100644
> --- a/src/include/denc.h
> +++ b/src/include/denc.h
> @@ -722,7 +722,7 @@ struct denc_traits<
> template
> struct denc_traits<
>   std::vector,
> -  typename std::enable_if::type> {
> +  typename std::enable_if::type> {
>   typedef denc_traits traits;
> 
>   enum { supported = true };
> @@ -831,7 +831,7 @@ struct denc_traits<
> template
> struct denc_traits<
>   std::set,
> -  typename std::enable_if::type> {
> +  typename std::enable_if::type> {
>   typedef denc_traits traits;
> 
>   enum { supported = true };
> 
> And the conclusion is that std::enable_if<> does not always like it when
> the value is 'int'.
> the definition of supported is:
> struct denc_traits {
>  enum { supported = 0 };
>  enum { featured = false };
>  enum { bounded = false };
> };
> 
> and values can range 0..2.
> 
> So is this a GCC liberalization, or is Clang here to picky?

It's hard to say without the full source code and a reproducer, but I'd
say that enable_if has a bool as the first template argument, so it
can't match an int by default.  Maybe libstdc++ has a variant with an
int as the first template argument, but I haven't looked.

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Seeking help with some Clang trouble, compiling ceph

2016-10-21 Thread Willem Jan Withagen
On 21-10-2016 15:09, Willem Jan Withagen wrote:
> Hi,
> 
> All this Ceph stuff finally used to compile under FreeBSD.
> And all testss completed correctly.
> 
> But somewhere in the Ceph-tree there was a lot of template and trait
> code added/replaced.
> Problem is that this compiles under GCC, but Clang throws an error. It
> looks like it cannot select types of automagic conversion.
> 
> But this template/trait stuff is too much for me to wrap my head around.
> I'm reading up a lot, but that does not yet get me anywhere.
> 
> So I was wondering if anybody with more C++ knowledge would like to
> assist and give some clues as to how to fix this.
> 
> The error report is at:
> 
> http://cephdev.digiware.nl:8180/jenkins/job/ceph-freebsd/39/consoleFull
> 
> And the ceph code can be found at:
> https://github.com/ceph/ceph

Oke, the preson responsable for the change helped to figure it out, and
it looks like the following diff helps

diff --git a/src/include/denc.h b/src/include/denc.h
index 59f7686..caa095b 100644
--- a/src/include/denc.h
+++ b/src/include/denc.h
@@ -722,7 +722,7 @@ struct denc_traits<
 template
 struct denc_traits<
   std::vector,
-  typename std::enable_if::type> {
+  typename std::enable_if::type> {
   typedef denc_traits traits;

   enum { supported = true };
@@ -831,7 +831,7 @@ struct denc_traits<
 template
 struct denc_traits<
   std::set,
-  typename std::enable_if::type> {
+  typename std::enable_if::type> {
   typedef denc_traits traits;

   enum { supported = true };

And the conclusion is that std::enable_if<> does not always like it when
the value is 'int'.
the definition of supported is:
struct denc_traits {
  enum { supported = 0 };
  enum { featured = false };
  enum { bounded = false };
};

and values can range 0..2.

So is this a GCC liberalization, or is Clang here to picky?

Thanx,
--WjW


___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"


Seeking help with some Clang trouble, compiling ceph

2016-10-21 Thread Willem Jan Withagen
Hi,

All this Ceph stuff finally used to compile under FreeBSD.
And all testss completed correctly.

But somewhere in the Ceph-tree there was a lot of template and trait
code added/replaced.
Problem is that this compiles under GCC, but Clang throws an error. It
looks like it cannot select types of automagic conversion.

But this template/trait stuff is too much for me to wrap my head around.
I'm reading up a lot, but that does not yet get me anywhere.

So I was wondering if anybody with more C++ knowledge would like to
assist and give some clues as to how to fix this.

The error report is at:

http://cephdev.digiware.nl:8180/jenkins/job/ceph-freebsd/39/consoleFull

And the ceph code can be found at:
https://github.com/ceph/ceph

--WjW
___
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"