zero sized initializers with side effects discarded

Gabriel Dos Reis gdr@integrable-solutions.net
Fri Sep 9 14:24:00 GMT 2005


Daniel Berlin <dberlin@dberlin.org> writes:

| >    int main(void)
| >    {
| >      spinlock_t lock = (spinlock_t) { .raw_lock = one_raw_spinlock() };
| 
| What exactly is this code expected to do?
| Call one_raw_spinlock and then throw away the result?

yes, that is implied by C99 semantics.

-- Gaby



More information about the Gcc mailing list