[issue46357] socket module fix warning build on FreeBSD

2022-01-13 Thread David CARLIER


Change by David CARLIER :


--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46357] socket module fix warning build on FreeBSD

2022-01-13 Thread David CARLIER


David CARLIER  added the comment:

I get what you mean now I thought memset was enough.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46357] socket module fix warning build on FreeBSD

2022-01-13 Thread STINNER Victor


STINNER Victor  added the comment:

> I took as initialized to avoid undefined behavior rather than anything.

I don't get what you mean.

Can you please show me which functions initialize sockaddr_l2cap structures and 
explain how the current code fills all members?

I don't know the code well enough to approve your PR 30560.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46357] socket module fix warning build on FreeBSD

2022-01-12 Thread David CARLIER


David CARLIER  added the comment:

I took as initialized to avoid undefined behavior rather than anything.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46357] socket module fix warning build on FreeBSD

2022-01-12 Thread STINNER Victor


STINNER Victor  added the comment:

> Solves the "Make sure new member of socket address initialized." warning for 
> the bluetooth sockaddr_l2cap usage.

You would to elaborate how you checked that all members of the socket address 
are initialized? Which socketmodule.c functions use this type? Are all members 
initialized?

https://www.leidinger.net/FreeBSD/dox/netgraph/html/d2/de3/structsockaddr__l2cap.html

A quick search points me to:
https://www.leidinger.net/FreeBSD/dox/netgraph/html/d2/de3/structsockaddr__l2cap.html
---
u_char  l2cap_len 
u_char  l2cap_family 
u_int16_t   l2cap_psm 
bdaddr_tl2cap_bdaddr 
u_int16_t   l2cap_cid 
u_int8_tl2cap_bdaddr_type
---

In BTPROTO_L2CAP case of getsockaddrarg(), it seems like only l2cap_family and 
l2cap_bdaddr are set, other members are set to 0. Is it enough? It seems like 
the important call is:

memset(addr, 0, sizeof(struct sockaddr_l2));

On FreeBSD, socketmodule.c uses:

#define sockaddr_l2 sockaddr_l2cap

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46357] socket module fix warning build on FreeBSD

2022-01-12 Thread David CARLIER


New submission from David CARLIER :

- Solves the "Make sure new member of socket address initialized." warning for 
the bluetooth sockaddr_l2cap usage.

--
components: FreeBSD
messages: 410419
nosy: devnexen, koobs
priority: normal
pull_requests: 28761
severity: normal
status: open
title: socket module fix warning build on FreeBSD
type: compile error
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com