Good time stork. I have this code.
dburl = db_short_url_find( conf, &(RQ) ); if( dburl == NULL ) { hash = ngx_hash_strlow( RQ.data, RQ.data, RQ.len); dburl = ngx_hash_find(&conf->short_url_hash, hash, RQ.data, RQ.len); /* if not found, use {RQ} */ if( NULL == dburl ) { dburl = &(RQ); } } in the second if condition, the condition is always satisfied, even when (I saw it myself) the bdurl is no longer NULL, apparently optimization. The same thing happens if if to bring out (initially it was) and put after the first if-a. dburl == NULL or NULL == dburl is also not important.
#pragma GCC push_options #pragma GCC optimize ("что-нить") .... #pragma GCC pop_options Perhaps as an option. But ... firstly, the function is large, and I would not want to deprive it of all optimization, and secondly, what option is responsible for "such optimization" ?? In general, you need either the correct pragma, preferably on a piece of code, or a trick to bypass the "smart" compiler ... I will be glad to any constructive ideas.
volatileto it in the declaration. - Arty OneSoul