This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
stray quotation marks warning enhancement or extension
- From: Daniel Gutson <daniel dot gutson at tallertechnologies dot com>
- To: gcc Mailing List <gcc at gcc dot gnu dot org>
- Date: Thu, 31 Mar 2016 17:10:37 -0300
- Subject: stray quotation marks warning enhancement or extension
- Authentication-results: sourceware.org; auth=none
Hi,
many times we copy code snippets from sources that change the
Unicode quotation marks ( â â ) rather than " ". For example
const std::string a_string(âHelloâ);
That line looks innocent but causes gcc to say
xxxxx.cpp:4:1: error: stray â\342â in program
const std::string a_string(âHelloâ);
^
misleading the poor programmer with such error message and wrong
column. A quick Google search says there are 171,000 matches for "
error: stray â\342â in program" which may show that this is a very
common issue.
I want to know if there is consensus to one of these solutions that I
can implement:
* improve the error message for the case of the Unicode quotes such
as adding "(seems Unicode quotes where used)"
* add a flag for a GNU extension so Unicode quotes are treated as
regular quotes
Feedback? I just don't want to waist time coding a solution that won't
be accepted.
Thanks,
Daniel.
--
Daniel F. Gutson
Chief Engineering Officer, SPD
San Lorenzo 47, 3rd Floor, Office 5
CÃrdoba, Argentina
Phone: +54 351 4217888 / +54 351 4218211
Skype: dgutson
LinkedIn: http://ar.linkedin.com/in/danielgutson