Re: Error Compiling on macOS

Denis Corbin <[email protected]> Wed, 24 Apr 2024 15:54:03 +0200
Newsgroups gmane.comp.sysutils.backup.dar.support
Message-ID <[email protected]>
On 24/04/2024 04:45, James Pedersen wrote:
> Hi,

Hi James,

> 
> When I try to compile dar 2.7.14 on MacOS Mojave, I get the following 
> error:
> 
> /In file included from archive.cpp:31/
> /In file included from ./i_archive.hpp:46:/
> /In file included from ./catalogue.hpp:46:/
> /./cat_entree.hpp:104:15: error: exception specification of explicitly 
> defaulted move assignment operator does not match the calculated one/
> /    cat_entree & operator = (cat_entree && ref) noexcept = default;/
> /
> /
> /In file included from archive.cpp:31:/
> /In file included from ./i_archive.hpp:46:/
> /In file included from ./catalogue.hpp:47:
> /
> /./cat_nomme.hpp:52:14: error: exception specification of explicitly 
> defaulted move assignment operator does not match the calculated one/
> /    cat_nomme & operator = (cat_nomme && ref) noexcept = default;/
> /
> /
> /2 errors generated./
> /make[3]: *** [archive.lo] Error 1/
> /make[2]: *** [all-recursive] Error 1/
> /make[1]: *** [all-recursive] Error 1/
> /Make:  *** [all] Error 2
> /
> /
> /
> How can I fix this error?

cat_entree and car_nomme classes have not changed since several 
releases, it seems related to the compiler you are using (probably clang?).

There has been changed in the past on whether a default copy and move 
assignment operator could have "noexcept" flag or not. g++ and clang are 
not always in sync on that, some years ago the noexcept flag needed to 
be removed:

https://stackoverflow.com/questions/41620922/default-noexcept-move-semantics

now it seems clang wants it to be added...

I will figure out what the new status of things for next release.

I'll probably have to enhance the configure script to check the behavior 
of the compiler used in regard of that type of hysterical complain... 
and have the code adapting on it.

In the meanwhile several path can be followed:
- using gcc instead of clang
- finding a flag in clang to disable this error (not sure it exists see 
below)
- edit libdar code adding (or rather removing) the "noexcept" keyworld 
in libdar code where clang is coughing... cat_entree.hpp line 104, 
cat_nomme.hpp line 52 and so on.

how to play with compiler flags (second point above):

export CXXFLAGS=-std=c++14
./configure ....
make ...

replace/add to -std=c++14 other flag if you find some more pertinent or 
interesting


> 
> Thank you,
> James Pedersen
> 
> 

Sorry to not provide a better solution for today

Regards,
Denis
OpenPGP_signature.asc (application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEEVeSEpqXFvH9T9/cuqLFBYNNrO6cFAmYpDvsFAwAAAAAACgkQqLFBYNNrO6e0
khAAn2hOBvvUPgJ66Cxq19B2FwPwC9xJ0ySp0gFqZNC8Z3GsaaOfFr00FC90sbW7+7by5Eoh2mIh
ZONRziyf1PYuQ6fUOFS+3fg4SvqvZSieyn/lmcVeBUHmfhedz8HRDTiDCp2GNUWRKScI2tDBD/5F
IeAje3BbH9MwGjT9PVaFz2mA5uBS/TR8V7xV9xq0JfuCO8B/wucKeJOx/uD1sjFXzu7Bs43Vz1ju
l4pKOK9JPGnjQlrGWi1vUAgHWUADJIjO2L5IRyjui48Os3hqB4Vi09Hfkz8COYrLlQmPnti+kq2H
aEv+EtjpCk7Gp6rmmVOZ938XefbfNjGFoIqCB3h1y0kHdRafaa1Mkoj4TP1G2xkn8mf6x73KqKph
ySYoBW9PMhMcaEwgu7YTi/qr+PYhO6+E378iWMSstMcicNrX0Xb5qF7nvpHK4YCdHUfQtXcCHpgQ
1OP0trVSLuiwr+IQbvKWuYvgEFLLQJPE4u0cd2bm9fWxFWh7e8QuvQ4+ushiq3kWSGmFfSxOODLm
HOJdWzfniD5QSizJodDLQASMkCfMy3r5vPkfg5xJb6NdNVP2riUdCbUjvwYUVHMMF0YIgQ4YANvf
SWw0vn5ePuxVm15CQdg7G/EkTKZ5HZHTgHx2XkzZbMaaFRch/VTb+FAoQBgPfFFsoUbNekyCOMcS
qJs=
=DUQf
-----END PGP SIGNATURE-----