All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 06/24] Fix all remaining warnings (missing declarations, missing prototypes)
Date: Tue, 08 Apr 2008 17:30:31 +0200	[thread overview]
Message-ID: <47FB8F97.7000406@trash.net> (raw)
In-Reply-To: <alpine.LNX.1.10.0804081640050.2229@fbirervta.pbzchgretzou.qr>

Jan Engelhardt wrote:
> On Sunday 2008-04-06 17:41, Patrick McHardy wrote:
>> Jan Engelhardt wrote:
>>> --- a/extensions/libip6t_LOG.c
>>> +++ b/extensions/libip6t_LOG.c
>>> @@ -269,6 +269,7 @@ static struct ip6tables_target log_target6 = {
>>>      .extra_opts    = LOG_opts,
>>>  };
>>>  
>>> +void _init(void);
>>>  void _init(void)
>>>  {
>>>   register_target6(&log_target6);
>> I don't like this very much.
> 
> But it is relatively error-safe.
> 
>> A global prototype
> 
> I remember why I did not do that... every .c file would have to
> #include "proto.h"
> or some kind - is this really that badly needed? This would also
> cause a needless recompilation of all modules if the list of
> modules changed.

I meant something like:

include/x_tables.h:

extern void _init(void);
extern void _exit(void);

Actually this should really be defined by gcc in my opinion.

>> or simply using __attribute__ ((constructor)) and
>> __attribute__ ((destructor)) would be preferred.
> 
> Been there, done that, threw it out. Doing a CTOR with iptables-static
> leads to a NULL deref because the ctors get run before any of the iptables
> data structures are initialized.
> 
> Of course, one can always cook up more and more magic, i.e. test
> for
> 
>    if (!initalized)
>        run_init_first();
> 
> in a ctor (as well as main(), for consistency), but that's the least
> thrilling thing to do IMO.

Good point, that idea sucks :)


  reply	other threads:[~2008-04-08 15:30 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-06 15:26 24-series iptables patches Jan Engelhardt
2008-04-06 15:26 ` [PATCH 01/24] Fix compilation of iptables-static build Jan Engelhardt
2008-04-06 15:26   ` [PATCH 02/24] Correct the family member value of libxt_mark revision 1 Jan Engelhardt
2008-04-06 15:31     ` Patrick McHardy
2008-04-06 15:27   ` [PATCH 03/24] Makefile: add a "tarball" target Jan Engelhardt
2008-04-06 15:32     ` Patrick McHardy
2008-04-06 15:27   ` [PATCH 04/24] Drop -W from CFLAGS and some tiny code cleanups Jan Engelhardt
2008-04-06 15:33     ` Patrick McHardy
2008-04-06 15:27   ` [PATCH 05/24] Fix -Wshadow warnings and clean up xt_sctp.h Jan Engelhardt
2008-04-06 15:35     ` Patrick McHardy
2008-04-06 15:27   ` [PATCH 06/24] Fix all remaining warnings (missing declarations, missing prototypes) Jan Engelhardt
2008-04-06 15:41     ` Patrick McHardy
2008-04-08 14:43       ` Jan Engelhardt
2008-04-08 15:30         ` Patrick McHardy [this message]
2008-04-08 16:14           ` Jan Engelhardt
2008-04-06 15:27   ` [PATCH 07/24] Add support for xt_hashlimit match revision 1 Jan Engelhardt
2008-04-06 15:27   ` [PATCH 08/24] Update the libxt_owner manpage with the UID/GID-range feature Jan Engelhardt
2008-04-06 16:31     ` Patrick McHardy
2008-04-06 15:27   ` [PATCH 09/24] Combine IP{,6}T_LIB_DIR into XTABLES_LIBDIR Jan Engelhardt
2008-04-06 15:27   ` [PATCH 10/24] Fixed incorrect call to find_match on loading a target Jan Engelhardt
2008-04-06 15:27   ` [PATCH 11/24] Move libipt_recent to libxt_recent Jan Engelhardt
2008-04-06 15:27   ` [PATCH 12/24] Add IPv6 support " Jan Engelhardt
2008-04-06 15:27   ` [PATCH 13/24] Add all necessary header files - compilation fix for various cases Jan Engelhardt
2008-04-06 15:27   ` [PATCH 14/24] configure: split --enable-libipq from --enable-devel Jan Engelhardt
2008-04-06 15:27   ` [PATCH 15/24] Update package name (Xtables) and documentation Jan Engelhardt
2008-04-06 15:27   ` [PATCH 16/24] Install libiptc header files because xtables.h depends on it Jan Engelhardt
2008-04-06 15:27   ` [PATCH 17/24] Remove support for compilation of conditional extensions Jan Engelhardt
2008-04-06 15:27   ` [PATCH 18/24] Combine ipt and ip6t manpages Jan Engelhardt
2008-04-06 15:27   ` [PATCH 19/24] Implement AF_UNSPEC as a wildcard for extensions Jan Engelhardt
2008-04-06 15:27   ` [PATCH 20/24] Change IPTABLES_VERSION to XTABLES_VERSION Jan Engelhardt
2008-04-06 15:27   ` [PATCH 21/24] libxt_recent: add missing --rsource,--rdest options to manpage Jan Engelhardt
2008-04-06 15:27   ` [PATCH 22/24] manpages: fix broken markup (missing close tags) Jan Engelhardt
2008-04-06 15:27   ` [PATCH 23/24] manpages: grammar and spelling Jan Engelhardt
2008-04-06 15:27   ` [PATCH 24/24] manpages: update to reflect fine-grained control Jan Engelhardt
2008-04-06 15:31   ` [PATCH 01/24] Fix compilation of iptables-static build Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47FB8F97.7000406@trash.net \
    --to=kaber@trash.net \
    --cc=jengelh@computergmbh.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.