[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-ddrescue] [PATCH 3/5] io: Add missing prototype
From: |
Rosen Penev |
Subject: |
Re: [Bug-ddrescue] [PATCH 3/5] io: Add missing prototype |
Date: |
Mon, 5 Aug 2019 09:58:00 -0700 |
On Mon, Aug 5, 2019 at 9:51 AM Antonio Diaz Diaz <address@hidden> wrote:
>
> Rosen Penev wrote:
> > Found with -Wmissing-prototypes
> > --- a/io.cc
> > +++ b/io.cc
> > @@ -34,6 +34,7 @@ namespace {
> >
> > int volatile signum_ = 0; // user pressed Ctrl-C or similar
> >
> > +extern "C" void sighandler( int signum );
> > extern "C" void sighandler( int signum )
> > { if( signum_ == 0&& signum> 0 ) signum_ = signum; }
>
> There is nothing missing here. A function definition is a function
> declaration in which the body of the function is presented. Therefore
> there is no need to declare the function twice.
My understanding here is that this function needs to be static or
declared separately. static cannot be used with extern so I went for
the other option.
>
> I would report this unneeded addition of a prototype as a bug to the
> compiler developers.
[Bug-ddrescue] [PATCH 2/5] treewide: Replace old style cast with static_cast, Rosen Penev, 2019/08/02
[Bug-ddrescue] [PATCH 4/5] command_mode: Add missing cctype header, Rosen Penev, 2019/08/02
[Bug-ddrescue] [PATCH 5/5] mapfile: Add several missing fclose calls, Rosen Penev, 2019/08/02
Re: [Bug-ddrescue] [PATCH 1/5] treewide: Replace 0 with NULL where appropriate, Antonio Diaz Diaz, 2019/08/05