Moving KDots to KDE Review

Minh Ngo nlminhtl at gmail.com
Thu Apr 9 12:11:53 BST 2015


Hi Ian,

Possibly it's because of the different stdlib (clang in Linux requires gcc,
but on Mac maybe it uses other stdlib
implementation), but I'm not sure about Mac. Is it possible to treat these
errors as warnings?

In the point.hpp the thing I did is just implemented a class Point that
consists from two coordinates and a hash function to store it in
std::unordered_*. Therefore please be free to change and don't fear about
breaking logic :).

Cheers,

Minh

On 9 April 2015 at 12:25, Ian Wadham <iandw.au at gmail.com> wrote:

> Hi Minh,
>
> On 06/04/2015, at 11:30 PM, Minh Ngo wrote:
> > Here is the patch. Checked with clang 3.5.0, qt 4.8.6, KDE Development
> Platform 4.14.6
>
> Thanks very much for the patch, Minh.  I tried it, but unfortunately
> the same errors persisted.
>
> > In file included from
> /kdedev/kde4m/kdesrc/kde/kdegames/kdots/point.cpp:26:
> > /kdedev/kde4m/kdesrc/kde/kdegames/kdots/point.hpp:78:10: error: explicit
> >       specialization of non-template struct 'hash'
> >   struct hash<KDots::Point>
> >          ^   ~~~~~~~~~~~~~~
> > /kdedev/kde4m/kdesrc/kde/kdegames/kdots/point.cpp:123:19: error:
> expected ';'
> >       after top level declarator
> >   std::size_t hash<KDots::Point>::operator()(const KDots::Point& s) const
> >                   ^
> >                   ;
> > 2 errors generated.
>
> I have not had time to investigate further in the last two days.  Maybe
> tomorrow.
>
> Possibly the Clang compiler is picking up the wrong stdlib from somewhere
> or
> maybe Clang does not like the mix of namespace and template features in
> this
> particular code.  Can it be paraphrased and simplified in some way?
>
> It is similar to the final coding example in
> http://en.cppreference.com/w/cpp/utility/hash,
> so it ought to compile OK, but it is not exactly the same.  I might try
> modifying point.hpp
> to be textually and syntactically more like the example, without changing
> semantics.
>
> Another possibility is for me to try MacPorts' (Open Source) Clang, rather
> than Apple's,
> but I use Apple's Clang successfully for all other code.  Or I might be
> able to revert to
> MacPorts' gcc.
>
> Cheers, Ian W.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20150409/91f4307d/attachment.htm>
-------------- next part --------------
_______________________________________________
kde-games-devel mailing list
kde-games-devel at kde.org
https://mail.kde.org/mailman/listinfo/kde-games-devel


More information about the kde-core-devel mailing list