[New-bugs-announce] [issue38682] struct timeval is not declared

Mithil report at bugs.python.org
Mon Nov 4 04:36:12 EST 2019


New submission from Mithil <mithil467 at gmail.com>:

pytime.h compilation gives warnings - 

pytime.h:123:59: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
 PyAPI_FUNC(int) _PyTime_FromTimeval(_PyTime_t *tp, struct timeval *tv);
                                                           ^~~~~~~
pytime.h:130:12: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
     struct timeval *tv,
            ^~~~~~~
pytime.h:135:12: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
     struct timeval *tv,

=====

I think the reason for this is that the struct timeval isn't declared anywhere before the declaration of this function. For me on windows, the structure is defined inside of winsock.h and including it before the other python header files fixes the problem.

----------
components: Windows
messages: 355932
nosy: Mithil, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: struct timeval is not declared
type: compile error
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38682>
_______________________________________


More information about the New-bugs-announce mailing list