Skip to content

Commit 8f5cdfa

Browse files
authored
Only define get_zone() and get_gmtoff() if needed (#1193)
Only define the get_zone() and get_gmtoff() private functions in the time module if these functions are needed to initialize the module. The change fixes the following warnings on AIX: Modules/timemodule.c:1175:1: warning: 'get_gmtoff' defined but not used [-Wunused-function] Modules/timemodule.c:1164:1: warning: 'get_zone' defined but not used [-Wunused-function]
1 parent d20324a commit 8f5cdfa

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Modules/timemodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,7 @@ PyDoc_STRVAR(get_clock_info_doc,
11601160
\n\
11611161
Get information of the specified clock.");
11621162

1163+
#if !defined(HAVE_TZNAME) || defined(__GLIBC__) || defined(__CYGWIN__)
11631164
static void
11641165
get_zone(char *zone, int n, struct tm *p)
11651166
{
@@ -1180,6 +1181,7 @@ get_gmtoff(time_t t, struct tm *p)
11801181
return timegm(p) - t;
11811182
#endif
11821183
}
1184+
#endif /* !defined(HAVE_TZNAME) || defined(__GLIBC__) || defined(__CYGWIN__) */
11831185

11841186
static void
11851187
PyInit_timezone(PyObject *m) {

0 commit comments

Comments
 (0)