<div dir="ltr"><div><div><div>Hi,<br><br></div>This is my first message in this list (plz be gentle).<br><br></div>I've been wanting to contribute to llvm/clang for quite sometime and here it is.<br><br>Subject of the matter today is errors on parsing of initializer list.<br><br></div><div>When parsing a malformed initializer list, specifically one in which 1 or more commas are missing, such as this<br><br>int a[] = {1 22222 33333, 4};<br><br><br>The errors we get are not exactly close to what the compilee has intended. <br><br>test.c:6:18: error: expected '}'<br>    int a[] = {1 22222 33333, 4};<br>                 ^<br>test.c:6:15: note: to match this '{'<br>    int a[] = {1 22222 33333, 4};<br><br></div><div>Now the reason why I assume the commas are missing is because it seems to be the most obvious things that happened here.<br></div><div><br></div><div>So I've went ahead and created a diagnostic which I deemed as more meaningful and more likely to match what the compilee has intended.<br><br></div><div>The behaviour is to note the areas where the expected commas would be and simply suggest inserting them.<br></div><div><br></div><div>Unfortunately the output doesn't quite line up in the email. So I'm attaching a copy if an input program and what the patched clang outputs as errors<br><br></div><div>Regards,<br><br></div><div>Zaid<br><br></div><div><a href="mailto:zaid.alkhishman@gmail.com">zaid.alkhishman@gmail.com</a><br></div><div><br></div></div>