This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/46759] incorrect array bounds warning?


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46759

--- Comment #3 from rwgk at yahoo dot com 2010-12-02 19:47:29 UTC ---
Created attachment 22606
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22606
reproducer with additional tests

I changed the original reproducer to return 0 through 4 instead of true or
false to verify that each branch is exercised with added tests. The output is
as expected and valgrind doesn't report problems. Therefore I still believe the
warning misfires.

Assuming my code holds up under further scrutinization:
It clearly is a minor problem but it creates distracting noise. If it is too
much trouble to fix in the 4.5 branch, could the example be added to the test
suite in the trunk, so that the same problem doesn't crop up again in the
future?


% valgrind a.out                          ==20636== Memcheck, a memory error
detector
==20636== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==20636== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==20636== Command: a.out
==20636==
0
0
1
1
2
2
3
3
4
4
4
==20636==
==20636== HEAP SUMMARY:
==20636==     in use at exit: 0 bytes in 0 blocks
==20636==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==20636==
==20636== All heap blocks were freed -- no leaks are possible
==20636==
==20636== For counts of detected and suppressed errors, rerun with: -v
==20636== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 6 from 6)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]