New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

NetBSD 8 adds support of AF_CAN (previously it was supported only on Linux). 
This causes a compilation error in socketmodule.c, because AF_CAN is defined in 
sys/socket.h, but sys/socket.h itself doesn't contain all necessary definitions 
for handling AF_CAN addresses. This also exposed other errors. The braces are 
not balanced if AF_CAN is defined, but CAN_RAW and CAN_BCM are not. 
PyBytes_AS_STRING() is called for non-bytes.

The proposed patch balances #ifdef/#endif with braces, undefines AF_CAN if it 
is not usable (following the practice for other AF_* constants), separates 
support of CAN_RAW and CAN_BCM (only the former is defined on NetBSD 8), adds 
comments to #endif for helping with navigation, adds the const qualifier to 
char pointers that always point to constant data, fixes indentation.

This fixed a compilation on NetBSD 8, and I hope this will fix a compilation on 
other platforms that will add AF_CAN. In a separate issue I'll add a support of 
AF_CAN on NetBSD (in 3.7 only).

----------
assignee: serhiy.storchaka
components: Extension Modules
messages: 305439
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Fix compiling the socket module on NetBSD 8 and other issues
type: compile error
versions: Python 2.7, Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31927>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to