antoineco / broadcom-wl

Broadcom Linux hybrid wireless driver (64-bit)
https://www.broadcom.com/support/download-search?pg=Wireless+Embedded+Solutions+and+RF+Components&pf=Legacy+Wireless&pa=Driver&dk=BCM4312&l=true
161 stars 47 forks source link

Warning about redefined 'isprint' macro with GCC 12 #29

Closed antoineco closed 2 years ago

antoineco commented 2 years ago

GCC 12 is complaining about the isprint macro which is redefined here as an alias to bcm_isprint:

https://github.com/antoineco/broadcom-wl/blob/6175bee2f67635119f6782996c52ce3a5b73f9f7/src/wl/sys/wl_iw.h#L73

In file included from /home/fedora/actions-runner/_work/broadcom-wl/broadcom-wl/src/wl/sys/wl_linux.c:81:
/home/fedora/actions-runner/_work/broadcom-wl/broadcom-wl/src/wl/sys/wl_iw.h:73: warning: "isprint" redefined
   73 | #define isprint(c) bcm_isprint(c)
      | 
In file included from ./include/linux/string_helpers.h:6,
                 from ./include/linux/seq_file.h:7,
                 from ./include/linux/seq_file_net.h:5,
                 from ./include/net/net_namespace.h:183,
                 from ./include/linux/netdevice.h:38,
                 from /home/fedora/actions-runner/_work/broadcom-wl/broadcom-wl/src/include/linuxver.h:69,
                 from /home/fedora/actions-runner/_work/broadcom-wl/broadcom-wl/src/wl/sys/wl_linux.c:27:
./include/linux/ctype.h:30: note: this is the location of the previous definition
   30 | #define isprint(c)      ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0)
      | 

The original definition is here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/ctype.h?id=v5.18#n30

It isn't clear to me why this macro is redefined since bcm_isprint looks identical to isprint, except for the BCM_ prefixes:

https://github.com/antoineco/broadcom-wl/blob/6175bee2f67635119f6782996c52ce3a5b73f9f7/src/include/bcmutils.h#L29-L39

Original: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/ctype.h?id=v5.18#n12