Rosen Penev wrote:
+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.

Why does it need to be static or declared separately? I can see nothing in the C++ standard requiring that. AFAICT, all that is required is that the function is declared before being used, and a definition is also a declaration.

_______________________________________________
Bug-ddrescue mailing list
Bug-ddrescue@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-ddrescue

Reply via email to