[Bug c/52952] Wformat location info is bad (wrong column number)

2018-10-06 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #53 from David Malcolm --- (In reply to Manuel López-Ibáñez from comment #51) > 2. Locations within strings expanded from a macro (2) should also be fixed for gcc 9 by r264887: /tmp/foo.c: In function ‘foo’: /tmp/foo.c:2:25:

[Bug c/52952] Wformat location info is bad (wrong column number)

2018-10-06 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #52 from David Malcolm --- (In reply to Manuel López-Ibáñez from comment #51) > 1. C++ does not work C++ should be fixed for gcc 9 by r264887.

[Bug c/52952] Wformat location info is bad (wrong column number)

2018-10-05 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Bug 52952 depends on bug 56856, which changed state. Bug 56856 Summary: -Wformat warnings don't show location *within* format string in C++ FE https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56856 What|Removed

[Bug c/52952] Wformat location info is bad (wrong column number)

2018-09-16 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #51 from Manuel López-Ibáñez --- There are few things still that don't work: 1. C++ does not work 2. Locations within strings expanded from a macro 3. Location within strings from a const char array. void foo(void) { #define c

[Bug c/52952] Wformat location info is bad (wrong column number)

2018-07-29 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #50 from Eric Gallager --- (In reply to Bernd Edlinger from comment #49) > Author: edlinger > Date: Mon Aug 22 07:34:34 2016 > New Revision: 239649 > > URL: https://gcc.gnu.org/viewcvs?rev=239649=gcc=rev > Log: > 2016-08-22 Bernd

[Bug c/52952] Wformat location info is bad (wrong column number)

2016-08-22 Thread edlinger at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #49 from Bernd Edlinger --- Author: edlinger Date: Mon Aug 22 07:34:34 2016 New Revision: 239649 URL: https://gcc.gnu.org/viewcvs?rev=239649=gcc=rev Log: 2016-08-22 Bernd Edlinger PR c/52952

[Bug c/52952] Wformat location info is bad (wrong column number)

2016-08-19 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #48 from Bernd Edlinger --- somethin like that fixes it for me: Index: pr66415-1.c === --- pr66415-1.c (revision 239624) +++ pr66415-1.c (working copy) @@ -1,6 +1,7 @@

[Bug c/52952] Wformat location info is bad (wrong column number)

2016-08-19 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #47 from Bernd Edlinger --- COLUMNS=82 make check-gcc-c RUNTESTFLAGS="cpp.exp=pr66415-1.c" ... Running /home/ed/gnu/gcc-trunk/gcc/testsuite/gcc.dg/cpp/cpp.exp ... === gcc Summary === # of expected passes

[Bug c/52952] Wformat location info is bad (wrong column number)

2016-08-19 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Bernd Edlinger changed: What|Removed |Added CC||bernd.edlinger at hotmail dot de ---

[Bug c/52952] Wformat location info is bad (wrong column number)

2016-08-08 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #45 from David Malcolm --- Author: dmalcolm Date: Mon Aug 8 20:10:19 2016 New Revision: 239253 URL: https://gcc.gnu.org/viewcvs?rev=239253=gcc=rev Log: Use class substring_loc in c-format.c (PR c/52952) gcc/c-family/ChangeLog:

[Bug c/52952] Wformat location info is bad (wrong column number)

2016-07-26 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 David Malcolm changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned

[Bug c/52952] Wformat location info is bad (wrong column number)

2016-06-23 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 David Malcolm changed: What|Removed |Added CC||dmalcolm at gcc dot gnu.org --- Comment

[Bug c/52952] Wformat location info is bad (wrong column number)

2016-06-09 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #42 from Manuel López-Ibáñez --- (In reply to Manuel López-Ibáñez from comment #39) > 2. Handle non-contiguous strings: > > __builtin_printf(" %" "d ", 0.5); Right now, we detect that the offset is outside the first string and

[Bug c/52952] Wformat location info is bad (wrong column number)

2016-06-09 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Manuel López-Ibáñez changed: What|Removed |Added CC||ch3root at openwall dot com ---

[Bug c/52952] Wformat location info is bad (wrong column number)

2015-09-08 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Manuel López-Ibáñez changed: What|Removed |Added Last reconfirmed|2012-04-12 00:00:00 |2015-9-8 --- Comment #40 from

[Bug c/52952] Wformat location info is bad (wrong column number)

2015-05-21 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #38 from Manuel López-Ibáñez manu at gcc dot gnu.org --- Author: manu Date: Thu May 21 06:49:38 2015 New Revision: 223470 URL: https://gcc.gnu.org/viewcvs?rev=223470root=gccview=rev Log: gcc/testsuite/ChangeLog: 2015-05-21 Manuel

[Bug c/52952] Wformat location info is bad (wrong column number)

2015-05-21 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #39 from Manuel López-Ibáñez manu at gcc dot gnu.org --- A summary of what is still pending: 1. Handle macros #define c%d __builtin_printf(c, 0.5); 2. Handle non-contiguous strings: __builtin_printf( % d ,

[Bug c/52952] Wformat location info is bad (wrong column number)

2015-03-27 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #37 from Manuel López-Ibáñez manu at gcc dot gnu.org --- (In reply to do...@seketeli.org from comment #9) manu at gcc dot gnu.org gcc-bugzi...@gcc.gnu.org a écrit: So either one keeps track of all source locations of all

[Bug c/52952] Wformat location info is bad (wrong column number)

2014-11-08 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #36 from Manuel López-Ibáñez manu at gcc dot gnu.org --- Latest patch: https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00663.html Joseph pointed out that it does not handle escape sequences. The only solution I can think of is to open

[Bug c/52952] Wformat location info is bad (wrong column number)

2014-10-05 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Manuel López-Ibáñez manu at gcc dot gnu.org changed: What|Removed |Added Attachment #33647|0 |1

[Bug c/52952] Wformat location info is bad (wrong column number)

2014-10-05 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #33 from Manuel López-Ibáñez manu at gcc dot gnu.org --- (In reply to Manuel López-Ibáñez from comment #32) Created attachment 33648 [details] dynamically create locations from loc + offset This version is able to handle macros:

[Bug c/52952] Wformat location info is bad (wrong column number)

2014-10-05 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #34 from Manuel López-Ibáñez manu at gcc dot gnu.org --- (In reply to Manuel López-Ibáñez from comment #27) (In reply to Manuel López-Ibáñez from comment #25) * Cases like: 1: const str[] = something %d; 2: printf(str);

[Bug c/52952] Wformat location info is bad (wrong column number)

2014-10-05 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #35 from Manuel López-Ibáñez manu at gcc dot gnu.org --- (In reply to Jakub Jelinek from comment #13) I guess the C/C++ FEs could for non-trivial string literals put into a hash table mapping from locus_t (of ADDR_EXPR around

[Bug c/52952] Wformat location info is bad (wrong column number)

2014-10-04 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Manuel López-Ibáñez manu at gcc dot gnu.org changed: What|Removed |Added Attachment #27466|0 |1

[Bug c/52952] Wformat location info is bad (wrong column number)

2014-10-04 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #31 from Manuel López-Ibáñez manu at gcc dot gnu.org --- (In reply to Manuel López-Ibáñez from comment #30) Created attachment 33647 [details] create locations from loc + offset This variant works for simple strings. However, it

[Bug c/52952] Wformat location info is bad (wrong column number)

2014-08-18 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #29 from Manuel López-Ibáñez manu at gcc dot gnu.org --- Author: manu Date: Tue Aug 19 02:02:09 2014 New Revision: 214129 URL: https://gcc.gnu.org/viewcvs?rev=214129root=gccview=rev Log: gcc/c-family/ChangeLog: 2014-08-19 Manuel

[Bug c/52952] Wformat location info is bad (wrong column number)

2014-08-05 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #27 from Manuel López-Ibáñez manu at gcc dot gnu.org --- (In reply to Manuel López-Ibáñez from comment #25) * Cases like: 1: const str[] = something %d; 2: printf(str); Note that clang is able to handle this: manuel@gcc10:~$

[Bug c/52952] Wformat location info is bad (wrong column number)

2014-08-05 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #28 from Manuel López-Ibáñez manu at gcc dot gnu.org --- Testcase: void foo(void) { char str[] = something %d; __builtin_printf(str); }

[Bug c/52952] Wformat location info is bad (wrong column number)

2014-02-20 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Manuel López-Ibáñez manu at gcc dot gnu.org changed: What|Removed |Added CC||chengniansun

[Bug c/52952] Wformat location info is bad (wrong column number)

2013-04-05 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #25 from Manuel López-Ibáñez manu at gcc dot gnu.org 2013-04-05 22:02:26 UTC --- I am currently stuck on the three problems I described above and I cannot figure out a way to fix any of them: * How to reprocess tokens that need to

[Bug c/52952] Wformat location info is bad (wrong column number)

2013-04-01 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #22 from Manuel López-Ibáñez manu at gcc dot gnu.org 2013-04-01 14:17:45 UTC --- (In reply to comment #13) and didn't need to be translated. So, printf (%.*d); (the common case) wouldn't have to be recorded, while printf (R(%) .

[Bug c/52952] Wformat location info is bad (wrong column number)

2013-04-01 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Manuel López-Ibáñez manu at gcc dot gnu.org changed: What|Removed |Added Attachment #29753|0 |1

[Bug c/52952] Wformat location info is bad (wrong column number)

2013-04-01 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #24 from Paolo Carlini paolo.carlini at oracle dot com 2013-04-01 14:32:27 UTC --- (Nit: careful with the GCC coding style, eg, open curly bracket on a new line)

[Bug c/52952] Wformat location info is bad (wrong column number)

2013-03-30 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #15 from Manuel López-Ibáñez manu at gcc dot gnu.org 2013-03-30 12:32:08 UTC --- (In reply to comment #13) I guess the C/C++ FEs could for non-trivial string literals put into a hash table mapping from locus_t (of ADDR_EXPR around

[Bug c/52952] Wformat location info is bad (wrong column number)

2013-03-30 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #16 from Manuel López-Ibáñez manu at gcc dot gnu.org 2013-03-30 12:32:57 UTC --- Created attachment 29753 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=29753 loc_token_hash

[Bug c/52952] Wformat location info is bad (wrong column number)

2013-03-30 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Manuel López-Ibáñez manu at gcc dot gnu.org changed: What|Removed |Added CC||joseph at

[Bug c/52952] Wformat location info is bad (wrong column number)

2013-03-30 Thread stevenb.gcc at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #18 from stevenb.gcc at gmail dot com stevenb.gcc at gmail dot com 2013-03-30 12:54:12 UTC --- * It would be extremely nice to update the testsuite to check the locations are correct. This is unfortunately a lot of boring

[Bug c/52952] Wformat location info is bad (wrong column number)

2013-03-30 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #19 from Manuel López-Ibáñez manu at gcc dot gnu.org 2013-03-30 13:26:19 UTC --- Unfortunately, there are some stuff like this: addr_expr 0x7708f680 type pointer_type 0x77094690 type array_type 0x77094540

[Bug c/52952] Wformat location info is bad (wrong column number)

2013-03-30 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #20 from Manuel López-Ibáñez manu at gcc dot gnu.org 2013-03-30 15:02:11 UTC --- (In reply to comment #18) * It would be extremely nice to update the testsuite to check the locations are correct. This is unfortunately a lot of

[Bug c/52952] Wformat location info is bad (wrong column number)

2013-03-30 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #21 from Manuel López-Ibáñez manu at gcc dot gnu.org 2013-03-30 15:03:14 UTC --- Created attachment 29755 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=29755 add locations and offsets to format warnings My current patch,

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-06-04 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Manuel López-Ibáñez manu at gcc dot gnu.org changed: What|Removed |Added CC||tromey at

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-25 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #12 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-05-25 14:09:00 UTC --- Basically, the current encoding of the map requires that a new location encoding in a map must always be the last location of that map. You cannot

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-25 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #13 from Jakub Jelinek jakub at gcc dot gnu.org 2012-05-25 14:17:41 UTC --- I guess the C/C++ FEs could for non-trivial string literals put into a hash table mapping from locus_t (of ADDR_EXPR around STRING_CST) to the first cpp token

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-24 Thread dodji at seketeli dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #9 from dodji at seketeli dot org dodji at seketeli dot org 2012-05-24 18:38:40 UTC --- manu at gcc dot gnu.org gcc-bugzi...@gcc.gnu.org a écrit: So either one keeps track of all source locations of all interesting characters

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-24 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #10 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-05-24 19:05:26 UTC --- (In reply to comment #9) manu at gcc dot gnu.org gcc-bugzi...@gcc.gnu.org a écrit: So either one keeps track of all source locations of all

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-24 Thread dodji at seketeli dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #11 from dodji at seketeli dot org dodji at seketeli dot org 2012-05-24 20:30:10 UTC --- manu at gcc dot gnu.org gcc-bugzi...@gcc.gnu.org a écrit: With the current infrastructure, I fear we cannot re-process the format string

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-22 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #5 from Jakub Jelinek jakub at gcc dot gnu.org 2012-05-22 08:29:08 UTC --- The format string could be even something like void f() { __builtin_printf( u8Rabcd(%.)abcd *d); } So,

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-22 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #6 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-05-22 09:54:29 UTC --- (In reply to comment #3) What does clang report for this: #include stdio.h void f() { printf( %. *d); } ? /tmp/webcompile/_2090_0.c:5:2:

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-22 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #7 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-05-22 10:55:49 UTC --- (In reply to comment #5) The format string could be even something like void f() { __builtin_printf( u8Rabcd(%.)abcd

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-22 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #8 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-05-22 11:04:41 UTC --- (In reply to comment #3) What does clang report for this: #include stdio.h void f() { printf( %. *d); } ? An even more interesting example

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-21 Thread steven at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #3 from Steven Bosscher steven at gcc dot gnu.org 2012-05-21 23:15:31 UTC --- What does clang report for this: #include stdio.h void f() { printf( %. *d); } ?

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-21 Thread steven at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #4 from Steven Bosscher steven at gcc dot gnu.org 2012-05-21 23:21:04 UTC --- Created attachment 27466 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=27466 Pass around the location of the format string First, admittedly rather

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-17 Thread steven at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 --- Comment #2 from Steven Bosscher steven at gcc dot gnu.org 2012-05-17 21:19:28 UTC --- To fix this properly, the input location should be tracked for the format string. The location of the format string as argument to printf is available in

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-05-17 Thread steven at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Steven Bosscher steven at gcc dot gnu.org changed: What|Removed |Added CC||steven at gcc

[Bug c/52952] Wformat location info is bad (wrong column number)

2012-04-12 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52952 Manuel López-Ibáñez manu at gcc dot gnu.org changed: What|Removed |Added Keywords||diagnostic