[Bug 277234] About the definition of FILE in the freebsd-src/include/stdio.h

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 23 Feb 2024 08:43:16 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277234

            Bug ID: 277234
           Summary: About the definition of FILE in the
                    freebsd-src/include/stdio.h
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: qianxliu@cisco.com

Created attachment 248688
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=248688&action=edit
The definition of FILE on the Ubuntu(Linux kernel, GNU)

https://github.com/freebsd/freebsd-src/blob/09cb8031b43c8e98abb5ff9b43ff649031d1e808/include/stdio.h#L121
Which is similar to the Mac System.

I found that Ubuntu(Linux kernel, GNU) used a different definition of FILE.
I don't know what's better, but I thought Linux seemed more robust(See the
png).

https://github.com/freebsd/freebsd-src/blob/09cb8031b43c8e98abb5ff9b43ff649031d1e808/include/stdio.h#L132

which means we possibly need to force-cast the void pointers of the function
parameters, and this standard seemed to be identified as a bug in the strict
standard. Because the C compiler is born with the type system and void is also
a type. This practice may violate the principle of type inheritance.

Anyway, it's the key part so I just propose my view to spark the discussions.

-- 
You are receiving this mail because:
You are the assignee for the bug.