Message ID | 20250107024120.98288-10-egyszeregy@freemail.hu (mailing list archive) |
---|---|
State | Awaiting Upstream |
Headers | show |
Series | netfilter: x_tables: Merge xt_*.h and ipt_*.h files which has same name. | expand |
On Tue, 7 Jan 2025, egyszeregy@freemail.hu wrote: > From: Benjamin Szőke <egyszeregy@freemail.hu> > > Display information about deprecated xt_*.h, ipt_*.h files > at compile time. Recommended to use header files with > lowercase name format in the future. I still don't know whether adding the pragmas to notify about header file deprecation is a good idea. On my part that's all. Thank you the work! Best regards, Jozsef > Signed-off-by: Benjamin Szőke <egyszeregy@freemail.hu> > --- > include/uapi/linux/netfilter/xt_CONNMARK.h | 2 ++ > include/uapi/linux/netfilter/xt_DSCP.h | 2 ++ > include/uapi/linux/netfilter/xt_MARK.h | 2 ++ > include/uapi/linux/netfilter/xt_RATEEST.h | 2 ++ > include/uapi/linux/netfilter/xt_TCPMSS.h | 2 ++ > include/uapi/linux/netfilter_ipv4/ipt_ECN.h | 2 ++ > include/uapi/linux/netfilter_ipv4/ipt_TTL.h | 2 ++ > include/uapi/linux/netfilter_ipv6/ip6t_HL.h | 2 ++ > 8 files changed, 16 insertions(+) > > diff --git a/include/uapi/linux/netfilter/xt_CONNMARK.h b/include/uapi/linux/netfilter/xt_CONNMARK.h > index 171af24ef679..1bc991fd546a 100644 > --- a/include/uapi/linux/netfilter/xt_CONNMARK.h > +++ b/include/uapi/linux/netfilter/xt_CONNMARK.h > @@ -4,4 +4,6 @@ > > #include <linux/netfilter/xt_connmark.h> > > +#pragma message("xt_CONNMARK.h header is deprecated. Use xt_connmark.h instead.") > + > #endif /* _XT_CONNMARK_TARGET_H */ > diff --git a/include/uapi/linux/netfilter/xt_DSCP.h b/include/uapi/linux/netfilter/xt_DSCP.h > index fcff72347256..bd550292803d 100644 > --- a/include/uapi/linux/netfilter/xt_DSCP.h > +++ b/include/uapi/linux/netfilter/xt_DSCP.h > @@ -4,4 +4,6 @@ > > #include <linux/netfilter/xt_dscp.h> > > +#pragma message("xt_DSCP.h header is deprecated. Use xt_dscp.h instead.") > + > #endif /* _XT_DSCP_TARGET_H */ > diff --git a/include/uapi/linux/netfilter/xt_MARK.h b/include/uapi/linux/netfilter/xt_MARK.h > index cdc12c0954b3..9f6c03e26c96 100644 > --- a/include/uapi/linux/netfilter/xt_MARK.h > +++ b/include/uapi/linux/netfilter/xt_MARK.h > @@ -4,4 +4,6 @@ > > #include <linux/netfilter/xt_mark.h> > > +#pragma message("xt_MARK.h header is deprecated. Use xt_mark.h instead.") > + > #endif /* _XT_MARK_H_TARGET_H */ > diff --git a/include/uapi/linux/netfilter/xt_RATEEST.h b/include/uapi/linux/netfilter/xt_RATEEST.h > index f817b5387164..ec3d68f67b2f 100644 > --- a/include/uapi/linux/netfilter/xt_RATEEST.h > +++ b/include/uapi/linux/netfilter/xt_RATEEST.h > @@ -4,4 +4,6 @@ > > #include <linux/netfilter/xt_rateest.h> > > +#pragma message("xt_RATEEST.h header is deprecated. Use xt_rateest.h instead.") > + > #endif /* _XT_RATEEST_TARGET_H */ > diff --git a/include/uapi/linux/netfilter/xt_TCPMSS.h b/include/uapi/linux/netfilter/xt_TCPMSS.h > index 154e88c1de02..826060264766 100644 > --- a/include/uapi/linux/netfilter/xt_TCPMSS.h > +++ b/include/uapi/linux/netfilter/xt_TCPMSS.h > @@ -4,4 +4,6 @@ > > #include <linux/netfilter/xt_tcpmss.h> > > +#pragma message("xt_TCPMSS.h header is deprecated. Use xt_tcpmss.h instead.") > + > #endif /* _XT_TCPMSS_TARGET_H */ > diff --git a/include/uapi/linux/netfilter_ipv4/ipt_ECN.h b/include/uapi/linux/netfilter_ipv4/ipt_ECN.h > index 6727f5a44512..42317fb3a4e9 100644 > --- a/include/uapi/linux/netfilter_ipv4/ipt_ECN.h > +++ b/include/uapi/linux/netfilter_ipv4/ipt_ECN.h > @@ -4,4 +4,6 @@ > > #include <linux/netfilter_ipv4/ipt_ecn.h> > > +#pragma message("ipt_ECN.h header is deprecated. Use ipt_ecn.h instead.") > + > #endif /* _IPT_ECN_TARGET_H */ > diff --git a/include/uapi/linux/netfilter_ipv4/ipt_TTL.h b/include/uapi/linux/netfilter_ipv4/ipt_TTL.h > index 5d989199ed28..1663493e4951 100644 > --- a/include/uapi/linux/netfilter_ipv4/ipt_TTL.h > +++ b/include/uapi/linux/netfilter_ipv4/ipt_TTL.h > @@ -4,4 +4,6 @@ > > #include <linux/netfilter_ipv4/ipt_ttl.h> > > +#pragma message("ipt_TTL.h header is deprecated. Use ipt_ttl.h instead.") > + > #endif /* _IPT_TTL_TARGET_H */ > diff --git a/include/uapi/linux/netfilter_ipv6/ip6t_HL.h b/include/uapi/linux/netfilter_ipv6/ip6t_HL.h > index bcf22824b393..55f08e20acd2 100644 > --- a/include/uapi/linux/netfilter_ipv6/ip6t_HL.h > +++ b/include/uapi/linux/netfilter_ipv6/ip6t_HL.h > @@ -4,4 +4,6 @@ > > #include <linux/netfilter_ipv6/ip6t_hl.h> > > +#pragma message("ip6t_HL.h header is deprecated. Use ip6t_hl.h instead.") > + > #endif /* _IP6T_HL_TARGET_H */ > -- > 2.43.5 > >
2025. 01. 07. 20:39 keltezéssel, Jozsef Kadlecsik írta: > On Tue, 7 Jan 2025, egyszeregy@freemail.hu wrote: > >> From: Benjamin Szőke <egyszeregy@freemail.hu> >> >> Display information about deprecated xt_*.h, ipt_*.h files >> at compile time. Recommended to use header files with >> lowercase name format in the future. > > I still don't know whether adding the pragmas to notify about header file > deprecation is a good idea. > Do you have any other ideas how can you display this information to the users/customers, that it is time to stop using the uppercase header files then they shall to use its merged lowercase named files instead in their userspace SW? > On my part that's all. Thank you the work! > > Best regards, > Jozsef > >> Signed-off-by: Benjamin Szőke <egyszeregy@freemail.hu> >> --- >> include/uapi/linux/netfilter/xt_CONNMARK.h | 2 ++ >> include/uapi/linux/netfilter/xt_DSCP.h | 2 ++ >> include/uapi/linux/netfilter/xt_MARK.h | 2 ++ >> include/uapi/linux/netfilter/xt_RATEEST.h | 2 ++ >> include/uapi/linux/netfilter/xt_TCPMSS.h | 2 ++ >> include/uapi/linux/netfilter_ipv4/ipt_ECN.h | 2 ++ >> include/uapi/linux/netfilter_ipv4/ipt_TTL.h | 2 ++ >> include/uapi/linux/netfilter_ipv6/ip6t_HL.h | 2 ++ >> 8 files changed, 16 insertions(+) >> >> diff --git a/include/uapi/linux/netfilter/xt_CONNMARK.h b/include/uapi/linux/netfilter/xt_CONNMARK.h >> index 171af24ef679..1bc991fd546a 100644 >> --- a/include/uapi/linux/netfilter/xt_CONNMARK.h >> +++ b/include/uapi/linux/netfilter/xt_CONNMARK.h >> @@ -4,4 +4,6 @@ >> >> #include <linux/netfilter/xt_connmark.h> >> >> +#pragma message("xt_CONNMARK.h header is deprecated. Use xt_connmark.h instead.") >> + >> #endif /* _XT_CONNMARK_TARGET_H */ >> diff --git a/include/uapi/linux/netfilter/xt_DSCP.h b/include/uapi/linux/netfilter/xt_DSCP.h >> index fcff72347256..bd550292803d 100644 >> --- a/include/uapi/linux/netfilter/xt_DSCP.h >> +++ b/include/uapi/linux/netfilter/xt_DSCP.h >> @@ -4,4 +4,6 @@ >> >> #include <linux/netfilter/xt_dscp.h> >> >> +#pragma message("xt_DSCP.h header is deprecated. Use xt_dscp.h instead.") >> + >> #endif /* _XT_DSCP_TARGET_H */ >> diff --git a/include/uapi/linux/netfilter/xt_MARK.h b/include/uapi/linux/netfilter/xt_MARK.h >> index cdc12c0954b3..9f6c03e26c96 100644 >> --- a/include/uapi/linux/netfilter/xt_MARK.h >> +++ b/include/uapi/linux/netfilter/xt_MARK.h >> @@ -4,4 +4,6 @@ >> >> #include <linux/netfilter/xt_mark.h> >> >> +#pragma message("xt_MARK.h header is deprecated. Use xt_mark.h instead.") >> + >> #endif /* _XT_MARK_H_TARGET_H */ >> diff --git a/include/uapi/linux/netfilter/xt_RATEEST.h b/include/uapi/linux/netfilter/xt_RATEEST.h >> index f817b5387164..ec3d68f67b2f 100644 >> --- a/include/uapi/linux/netfilter/xt_RATEEST.h >> +++ b/include/uapi/linux/netfilter/xt_RATEEST.h >> @@ -4,4 +4,6 @@ >> >> #include <linux/netfilter/xt_rateest.h> >> >> +#pragma message("xt_RATEEST.h header is deprecated. Use xt_rateest.h instead.") >> + >> #endif /* _XT_RATEEST_TARGET_H */ >> diff --git a/include/uapi/linux/netfilter/xt_TCPMSS.h b/include/uapi/linux/netfilter/xt_TCPMSS.h >> index 154e88c1de02..826060264766 100644 >> --- a/include/uapi/linux/netfilter/xt_TCPMSS.h >> +++ b/include/uapi/linux/netfilter/xt_TCPMSS.h >> @@ -4,4 +4,6 @@ >> >> #include <linux/netfilter/xt_tcpmss.h> >> >> +#pragma message("xt_TCPMSS.h header is deprecated. Use xt_tcpmss.h instead.") >> + >> #endif /* _XT_TCPMSS_TARGET_H */ >> diff --git a/include/uapi/linux/netfilter_ipv4/ipt_ECN.h b/include/uapi/linux/netfilter_ipv4/ipt_ECN.h >> index 6727f5a44512..42317fb3a4e9 100644 >> --- a/include/uapi/linux/netfilter_ipv4/ipt_ECN.h >> +++ b/include/uapi/linux/netfilter_ipv4/ipt_ECN.h >> @@ -4,4 +4,6 @@ >> >> #include <linux/netfilter_ipv4/ipt_ecn.h> >> >> +#pragma message("ipt_ECN.h header is deprecated. Use ipt_ecn.h instead.") >> + >> #endif /* _IPT_ECN_TARGET_H */ >> diff --git a/include/uapi/linux/netfilter_ipv4/ipt_TTL.h b/include/uapi/linux/netfilter_ipv4/ipt_TTL.h >> index 5d989199ed28..1663493e4951 100644 >> --- a/include/uapi/linux/netfilter_ipv4/ipt_TTL.h >> +++ b/include/uapi/linux/netfilter_ipv4/ipt_TTL.h >> @@ -4,4 +4,6 @@ >> >> #include <linux/netfilter_ipv4/ipt_ttl.h> >> >> +#pragma message("ipt_TTL.h header is deprecated. Use ipt_ttl.h instead.") >> + >> #endif /* _IPT_TTL_TARGET_H */ >> diff --git a/include/uapi/linux/netfilter_ipv6/ip6t_HL.h b/include/uapi/linux/netfilter_ipv6/ip6t_HL.h >> index bcf22824b393..55f08e20acd2 100644 >> --- a/include/uapi/linux/netfilter_ipv6/ip6t_HL.h >> +++ b/include/uapi/linux/netfilter_ipv6/ip6t_HL.h >> @@ -4,4 +4,6 @@ >> >> #include <linux/netfilter_ipv6/ip6t_hl.h> >> >> +#pragma message("ip6t_HL.h header is deprecated. Use ip6t_hl.h instead.") >> + >> #endif /* _IP6T_HL_TARGET_H */ >> -- >> 2.43.5 >> >> >
On Tuesday 2025-01-07 23:06, Szőke Benjamin wrote: >> >> I still don't know whether adding the pragmas to notify about header file >> deprecation is a good idea. > > Do you have any other ideas how can you display this information to the > users/customers, that it is time to stop using the uppercase header files then > they shall to use its merged lowercase named files instead in their userspace > SW? ``__attribute__`` is just as implementation-specific as ``#pragma``, so it's not really an improvement, but here goes: ---- struct __attribute__((deprecated("This header file is deprecated"))) dontusethisstruct { }; extern struct dontusethisstruct undefinedstruct; ----
2025. 01. 07. 23:38 keltezéssel, Jan Engelhardt írta: > > On Tuesday 2025-01-07 23:06, Szőke Benjamin wrote: >>> >>> I still don't know whether adding the pragmas to notify about header file >>> deprecation is a good idea. >> >> Do you have any other ideas how can you display this information to the >> users/customers, that it is time to stop using the uppercase header files then >> they shall to use its merged lowercase named files instead in their userspace >> SW? > > ``__attribute__`` is just as implementation-specific as ``#pragma``, so it's > not really an improvement, but here goes: > > ---- > struct __attribute__((deprecated("This header file is deprecated"))) dontusethisstruct { > }; > extern struct dontusethisstruct undefinedstruct; > ---- As i know it is a feature only in GCC, can it work with Clang compiler? https://renenyffenegger.ch/notes/development/languages/C-C-plus-plus/GCC/__attribute__/deprecated/index By the way it is perfect for through a warning for a deprecated struct, function etc ... only in GCC, but it is not ideal to use a simple header file include and the syntax of it is horryble. Usage of a generic #pragma message is more feasible in all compilers.
diff --git a/include/uapi/linux/netfilter/xt_CONNMARK.h b/include/uapi/linux/netfilter/xt_CONNMARK.h index 171af24ef679..1bc991fd546a 100644 --- a/include/uapi/linux/netfilter/xt_CONNMARK.h +++ b/include/uapi/linux/netfilter/xt_CONNMARK.h @@ -4,4 +4,6 @@ #include <linux/netfilter/xt_connmark.h> +#pragma message("xt_CONNMARK.h header is deprecated. Use xt_connmark.h instead.") + #endif /* _XT_CONNMARK_TARGET_H */ diff --git a/include/uapi/linux/netfilter/xt_DSCP.h b/include/uapi/linux/netfilter/xt_DSCP.h index fcff72347256..bd550292803d 100644 --- a/include/uapi/linux/netfilter/xt_DSCP.h +++ b/include/uapi/linux/netfilter/xt_DSCP.h @@ -4,4 +4,6 @@ #include <linux/netfilter/xt_dscp.h> +#pragma message("xt_DSCP.h header is deprecated. Use xt_dscp.h instead.") + #endif /* _XT_DSCP_TARGET_H */ diff --git a/include/uapi/linux/netfilter/xt_MARK.h b/include/uapi/linux/netfilter/xt_MARK.h index cdc12c0954b3..9f6c03e26c96 100644 --- a/include/uapi/linux/netfilter/xt_MARK.h +++ b/include/uapi/linux/netfilter/xt_MARK.h @@ -4,4 +4,6 @@ #include <linux/netfilter/xt_mark.h> +#pragma message("xt_MARK.h header is deprecated. Use xt_mark.h instead.") + #endif /* _XT_MARK_H_TARGET_H */ diff --git a/include/uapi/linux/netfilter/xt_RATEEST.h b/include/uapi/linux/netfilter/xt_RATEEST.h index f817b5387164..ec3d68f67b2f 100644 --- a/include/uapi/linux/netfilter/xt_RATEEST.h +++ b/include/uapi/linux/netfilter/xt_RATEEST.h @@ -4,4 +4,6 @@ #include <linux/netfilter/xt_rateest.h> +#pragma message("xt_RATEEST.h header is deprecated. Use xt_rateest.h instead.") + #endif /* _XT_RATEEST_TARGET_H */ diff --git a/include/uapi/linux/netfilter/xt_TCPMSS.h b/include/uapi/linux/netfilter/xt_TCPMSS.h index 154e88c1de02..826060264766 100644 --- a/include/uapi/linux/netfilter/xt_TCPMSS.h +++ b/include/uapi/linux/netfilter/xt_TCPMSS.h @@ -4,4 +4,6 @@ #include <linux/netfilter/xt_tcpmss.h> +#pragma message("xt_TCPMSS.h header is deprecated. Use xt_tcpmss.h instead.") + #endif /* _XT_TCPMSS_TARGET_H */ diff --git a/include/uapi/linux/netfilter_ipv4/ipt_ECN.h b/include/uapi/linux/netfilter_ipv4/ipt_ECN.h index 6727f5a44512..42317fb3a4e9 100644 --- a/include/uapi/linux/netfilter_ipv4/ipt_ECN.h +++ b/include/uapi/linux/netfilter_ipv4/ipt_ECN.h @@ -4,4 +4,6 @@ #include <linux/netfilter_ipv4/ipt_ecn.h> +#pragma message("ipt_ECN.h header is deprecated. Use ipt_ecn.h instead.") + #endif /* _IPT_ECN_TARGET_H */ diff --git a/include/uapi/linux/netfilter_ipv4/ipt_TTL.h b/include/uapi/linux/netfilter_ipv4/ipt_TTL.h index 5d989199ed28..1663493e4951 100644 --- a/include/uapi/linux/netfilter_ipv4/ipt_TTL.h +++ b/include/uapi/linux/netfilter_ipv4/ipt_TTL.h @@ -4,4 +4,6 @@ #include <linux/netfilter_ipv4/ipt_ttl.h> +#pragma message("ipt_TTL.h header is deprecated. Use ipt_ttl.h instead.") + #endif /* _IPT_TTL_TARGET_H */ diff --git a/include/uapi/linux/netfilter_ipv6/ip6t_HL.h b/include/uapi/linux/netfilter_ipv6/ip6t_HL.h index bcf22824b393..55f08e20acd2 100644 --- a/include/uapi/linux/netfilter_ipv6/ip6t_HL.h +++ b/include/uapi/linux/netfilter_ipv6/ip6t_HL.h @@ -4,4 +4,6 @@ #include <linux/netfilter_ipv6/ip6t_hl.h> +#pragma message("ip6t_HL.h header is deprecated. Use ip6t_hl.h instead.") + #endif /* _IP6T_HL_TARGET_H */