This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients serhiy.storchaka
Date 2017-11-02.16:15:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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).
Date User Action Args
2017-11-02 16:15:22serhiy.storchakasetrecipients: + serhiy.storchaka
2017-11-02 16:15:22serhiy.storchakasetmessageid: <>
2017-11-02 16:15:22serhiy.storchakalinkissue31927 messages
2017-11-02 16:15:22serhiy.storchakacreate