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

The optional comma at the end of the list of entries in an array is explicitly allowed by the C standard.


(Actually I may be confusing the extra comma here with an extra comma at the end of an enum list. Some compilers are OK with that, while others aren't.)


If I'm reading N1256 right (not sure how far back it actually dates, but that's a C standard draft dated 2007), section 6.7.2.3 also explicitly allows a trailing comma in that context as well, so if such a compiler exists its makers should get with the program, so to speak.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: