Page MenuHomeFreeBSD

Define ipfilter's SOLARIS macro in a more portable way
ClosedPublic

Authored by dim on Aug 27 2016, 10:17 PM.
Tags
None
Referenced Files
F132467606: D7671.diff
Fri, Oct 17, 4:32 AM
Unknown Object (File)
Sat, Sep 20, 10:47 PM
Unknown Object (File)
Sep 8 2025, 8:25 PM
Unknown Object (File)
Sep 8 2025, 8:19 AM
Unknown Object (File)
Sep 3 2025, 10:13 AM
Unknown Object (File)
Sep 3 2025, 2:49 AM
Unknown Object (File)
Aug 2 2025, 7:36 AM
Unknown Object (File)
Jul 26 2025, 8:14 PM
Subscribers

Details

Summary

From clang 3.9.0 I'm getting this warning about ipfilter's SOLARIS
macro:

In file included from ioctl.c:82:
/usr/obj/usr/src/tmp/usr/include/netinet/ip_fil.h:1080:6: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
# if    SOLARIS
        ^
/usr/obj/usr/src/tmp/usr/include/netinet/ip_compat.h:35:18: note: expanded from macro 'SOLARIS'
#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
                 ^

This can easily be done in a defined and portable way.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dim retitled this revision from to Define ipfilter's SOLARIS macro in a more portable way.
dim updated this object.
dim edited the test plan for this revision. (Show Details)
dim added reviewers: cy, glebius.
dim added a subscriber: emaste.
cy edited edge metadata.

Looks good.

Ultimately as I go through the code, all non-FreeBSD code will be removed. This works for now. Thanks.

This revision is now accepted and ready to land.Aug 27 2016, 11:57 PM
This revision was automatically updated to reflect the committed changes.