Web lists-archives.com

Re: [Mingw-users] mingw error: redefinition of 'struct timespec'




On 11/10/15 18:14, Eli Zaretskii wrote:
>> From: Keith Marshall <keithmarshall@xxxxxxxxxxxxxxxxxxxxx>
>> Date: Sun, 11 Oct 2015 17:56:36 +0100
>>
>> On 11/10/15 16:11, Eli Zaretskii wrote:
>>> My personal solution is (assuming you don't really need pthreads in
>>> that project) to rename the pthreads headers, so they "don't exist" as
>>> far as the configuration scripts are concerned.
>>
>> A reasonable approach, but kind of begs the question ... if the project
>> doesn't need pthreads, why would its configuration script(s) check for
>> <pthread.h>?
> 
> Because the standard GNU configure tests "know" this is one place
> where 'struct timespec' is declared.

Ah.  Okay, thanks for that clarification, but (being pedantic) should it
not rather look to <sched.h>, since that is where POSIX.1 requires
struct timespec to be defined?  (Of course, that definition would then
propagate through <pthread.h>, which is required to expose all of the
definitions within <sched.h> anyway, but selecting the outer header is
nothing short of blatant namespace pollution, especially since the
preferred origin for struct timespec is <time.h> in the first place).

>> (Unless, of course, it can use pthreads if supported, or some
>> alternative fall-back otherwise ... in which case lack of any such
>> alternative support could be something of a show-stopper).
> 
> No, most such packages don't use pthreads (or any threads), they just
> need the struct declaration.

In which case, they should favour <time.h> as its provider ... yes, I do
know that mingwrt-3.21 was broken in this respect, but that has been
corrected in mingwrt-3.21.1.  Any preference to elect for inclusion of
<pthread.h>, rather than <time.h>, if that's what it actually does just
for struct timespec, seems to me like it may be a misfeature of GNU
autoconf.

-- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe