Re: [dev] ot: C Standard noreturn

From: <u_AT_netbeisser.de>
Date: Thu, 22 Sep 2016 21:12:53 +0200

On Thu, Sep 22, 2016 at 09:03:57PM +0200, Markus Wichmann wrote:
> On Thu, Sep 22, 2016 at 08:04:44PM +0200, u_AT_netbeisser.de wrote:
> > main.c:7:10: error: expected ???=???, ???,???, ???;???, ???asm??? or ???__attribute__??? before ???void???
> > noreturn void __stack_chk_fail(void);
 
> noreturn is already a return type (in as much as void is one, namely
> syntactically), so remove the "void" and you should be fine.
>
> > tried
> > void __stack_chk_fail(void) __attribute ((noreturn));
> > instead.
 
> That however only works with gcc and compatibles.
 

Thanks for pointing out. In the meantime I wrote this, because I had a look at libssp.
I will call it money :)


#include <string.h>

int main(int argc, char **argv) {

if (strstr(argv[1],"buf")) {
__chk_fail();
} else if (strstr(argv[1],"fmt")) {
__stack_chk_fail();
}
return 0;
}
Received on Thu Sep 22 2016 - 21:12:53 CEST

This archive was generated by hypermail 2.3.0 : Thu Sep 22 2016 - 21:24:11 CEST