Hacker Newsnew | comments | show | ask | jobs | submitlogin

In GCC 4.4 and up you can use the following:

    #pragma GCC push_options
    #pragma GCC optimize ("O0")

    memset(a, 0, 3);

    #pragma GCC pop_options
'volatile' should also work, I don't see why there is any need to rewrite memset. Here is a related question on SO:


Edit: buried at the bottom of that post is another method:


Applications are open for YC Summer 2015

Guidelines | FAQ | Support | Lists | Bookmarklet | DMCA | Y Combinator | Apply | Contact