public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39462]  New: check assert() at compile time if possible
@ 2009-03-14 17:18 ich at az2000 dot de
  2009-03-14 17:33 ` [Bug c++/39462] " rguenth at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: ich at az2000 dot de @ 2009-03-14 17:18 UTC (permalink / raw)
  To: gcc-bugs

I have a lot of cases where it would be possible (more or less trivial,
depending on the situation/code) to check if an assert() would fail at compile
time. In such cases, I would want that GCC gives a warning (or an error).

I understand that it's not possible to catch all cases but on such cases where
it is easy for GCC to do such a check, I would like that GCC does it and
reports it if it would fail.

For the warning itself: The warning should point out the line where the problem
is really caused (or all lines which could cause that problem). E.g., if I have
an inline function where the assert depends on the function argument, I would
like to get the line-nr where I call that function, not the line-nr of the
assert() itself.

(Just to avoid confusion: I am aware of static asserts but these are different
things and not an option in most cases where I use assert(). Also, I don't want
to make things harder for myself to figure out always when I can use an static
assert and when not. And anyway, there are still a lot of trivial cases where a
static assert is not possible but it would be still trivial for the compiler to
see that it would fail.)


-- 
           Summary: check assert() at compile time if possible
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ich at az2000 dot de


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


^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <bug-39462-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2012-01-08 21:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-14 17:18 [Bug c++/39462] New: check assert() at compile time if possible ich at az2000 dot de
2009-03-14 17:33 ` [Bug c++/39462] " rguenth at gcc dot gnu dot org
2009-03-14 19:48 ` ich at az2000 dot de
2009-03-14 20:25 ` rguenth at gcc dot gnu dot org
2009-03-14 23:41 ` paolo dot carlini at oracle dot com
2009-03-15  0:10 ` ich at az2000 dot de
2009-03-15  0:32 ` paolo dot carlini at oracle dot com
2009-03-15  0:59 ` ich at az2000 dot de
     [not found] <bug-39462-4@http.gcc.gnu.org/bugzilla/>
2011-09-29  0:05 ` paolo.carlini at oracle dot com
2012-01-08 21:52 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).