Bug 271700

Summary: cc with rpc/pmap_prot.h and machine/pmap.h: different structures with the same name are used.
Product: Base System Reporter: Leo Vlassov <Leo_Vlassov>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Many People CC: freebsd, kib
Priority: ---    
Version: 13.1-RELEASE   
Hardware: amd64   
OS: Any   

Description Leo Vlassov 2023-05-29 05:54:02 UTC
at 13.1 and 13.2 OS versions

%: cc -c superbl.c
In file included from superbl.c:22:
In file included from /usr/include/rpc/rpc.h:74:
/usr/include/rpc/pmap_prot.h:90:8: error: redefinition of 'pmap'
struct pmap {
       ^
/usr/include/machine/pmap.h:380:8: note: previous definition is here
struct pmap {
       ^
1 error generated. 

#####
In rpc/pmap_prot.h:90:8: the structure `pmap' is different of machine/pmap.h the structure `pmap'....


It's a bug? -- different structures with the same name are used.
Comment 1 Konstantin Belousov freebsd_committer freebsd_triage 2023-05-29 09:51:59 UTC
Why it matter?  What is the kind of program that needs both machine/pmap.h
and port mapper services used in the same source?
Comment 2 Mina Galić freebsd_triage 2023-05-31 08:57:59 UTC
note that line 90 here https://github.com/freebsd/freebsd-src/blob/dc103686348d3205733a2c77e7d2ccbff6691022/sys/rpc/pmap_prot.h#L90 is "struct pirtmap" not "struct pmap" so something in your software is probably redefining portmap as pmap