But then, building with -pedantic triggers loads of warnings :-(



Ilja Booij wrote:
On Tue, 14 Sep 2004 16:03:36 +0200, Paul J Stevens <[EMAIL PROTECTED]> wrote:

I don't get it. Why doesn't freebsd like this code?

<code>
void manage_stop_children()
{
        /*
         *
         * cleanup all remaining forked processes
         *
         */
        trace(TRACE_MESSAGE, "%s,%s: General stop requested. Killing children.. 
",
                        __FILE__,__func__);
        int stillSomeAlive = 1;
        int i, cnt = 0;
        pid_t chpid;
        while (stillSomeAlive && cnt < 10) {
                stillSomeAlive = 0;
                cnt++;
</code>

It appears gcc on freebsd doesn't like 'int var=0' type declarations inside
functions. Or am I missing something else here.

Someone with access to freebsd please help me out here. Ilja?


I think it doesn't like the fact that the trace() call comes before
the variable declarations. If I compile with the '-pedantic' options,
I get the following message:

pool.c: In function `manage_stop_children':
pool.c:369: warning: ISO C89 forbids mixed declarations and code

If that's the problem, then the solution would be to put the trace()
call after all variable declarations.

BTW, I don't have a FreeBSD machine here, so I can't test it.

Ilja
_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://twister.fastxs.net/mailman/listinfo/dbmail-dev


--
  ________________________________________________________________
  Paul Stevens                                         [EMAIL PROTECTED]
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands_______________________________________www.nfg.nl

Reply via email to