public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/12391] New: regression: missing warning about assigning to an incomplete type
@ 2003-09-24 18:36 levon at movementarian dot org
2003-09-24 20:40 ` [Bug c/12391] [3.4 regression] " bangerth at dealii dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: levon at movementarian dot org @ 2003-09-24 18:36 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12391
Summary: regression: missing warning about assigning to an
incomplete type
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: levon at movementarian dot org
CC: gcc-bugs at gcc dot gnu dot org
Consider:
typedef struct { int a; } b_t;
int foo() { b_t d; struct b_t * c = &d; c->a; }
gcc 3.2 says :
a.c: In function `foo':
a.c:2: warning: initialization from incompatible pointer type
a.c:2: dereferencing pointer to incomplete type
GNU C version 3.4 20030914 (experimental) (i686-pc-linux-gnu) says :
a.c: In function `foo':
a.c:2: error: dereferencing pointer to incomplete type
Note the missing warning on initialisation. This can be moderately confusing
because the latter looks exactly like a "missing header" problem, but in fact
the problem is prepending the "struct" before the typedef name, which is
actually an incomplete type of "struct b_t".
The missing warning makes it obvious that it's not as simple as a missing
header.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/12391] [3.4 regression] missing warning about assigning to an incomplete type
2003-09-24 18:36 [Bug c/12391] New: regression: missing warning about assigning to an incomplete type levon at movementarian dot org
@ 2003-09-24 20:40 ` bangerth at dealii dot org
2003-12-19 6:37 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2003-09-24 20:40 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12391
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|minor |normal
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-09-24 18:40:24
date| |
Summary|regression: missing warning |[3.4 regression] missing
|about assigning to an |warning about assigning to
|incomplete type |an incomplete type
Target Milestone|--- |3.4
------- Additional Comments From bangerth at dealii dot org 2003-09-24 18:40 -------
Right, a mailine regression. What a vicious piece of code. The g++
front end gives this, btw, which I think is a good reason to change
your programming language :-)
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.c -W -Wall
x.c: In function `int foo()':
x.c:2: error: using typedef-name `b_t' after `struct'
x.c:2: warning: statement has no effect
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/12391] [3.4 regression] missing warning about assigning to an incomplete type
2003-09-24 18:36 [Bug c/12391] New: regression: missing warning about assigning to an incomplete type levon at movementarian dot org
2003-09-24 20:40 ` [Bug c/12391] [3.4 regression] " bangerth at dealii dot org
@ 2003-12-19 6:37 ` pinskia at gcc dot gnu dot org
2004-02-28 2:35 ` [Bug c/12391] [3.4/3.5 " mmitchel at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-19 6:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-12-19 05:59 -------
The regresion happened between 20030830 and 20030902.
I want to say it was caused by: <http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00003.html>
Or one of these two:
2003-08-30 Zack Weinberg <zack@codesourcery.com>
* c-tree.h: Delete COMPARE_DIFFERENT_TU from enumeration.
* c-typeck.c (same_translation_unit_p): New function.
(comptypes): Use it instead of flags parameter to identify
structure types from different translation units.
* c-decl.c (duplicate_decls): Always call comptypes with
COMPTYPE_STRICT flags argument.
(c_reset_state): Set BLOCK_SUPERCONTEXT of the block formed
to file_scope_decl.
2003-08-30 Zack Weinberg <zack@codesourcery.com>
* c-tree.h (C_TYPE_INCOMPLETE_VARS): New macro.
* c-decl.c (struct c_scope): Remove "incomplete" field.
(pushdecl): Attach variables with incomplete types to
the TYPE_MAIN_VARIANT of the incomplete type in question.
(finish_struct): Look at C_TYPE_INCOMPLETE_VARS for variables
to complete, not at current_scope->incomplete. All such
variables do need completion.
These are the only patches which touched the c front-end which could cause this problem.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |zack at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12391
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/12391] [3.4/3.5 regression] missing warning about assigning to an incomplete type
2003-09-24 18:36 [Bug c/12391] New: regression: missing warning about assigning to an incomplete type levon at movementarian dot org
2003-09-24 20:40 ` [Bug c/12391] [3.4 regression] " bangerth at dealii dot org
2003-12-19 6:37 ` pinskia at gcc dot gnu dot org
@ 2004-02-28 2:35 ` mmitchel at gcc dot gnu dot org
2004-03-16 20:57 ` zack at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-02-28 2:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-02-28 02:35 -------
This is a very minor issue: postponed until GCC 3.4.1.
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4.0 |3.4.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12391
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/12391] [3.4/3.5 regression] missing warning about assigning to an incomplete type
2003-09-24 18:36 [Bug c/12391] New: regression: missing warning about assigning to an incomplete type levon at movementarian dot org
` (2 preceding siblings ...)
2004-02-28 2:35 ` [Bug c/12391] [3.4/3.5 " mmitchel at gcc dot gnu dot org
@ 2004-03-16 20:57 ` zack at gcc dot gnu dot org
2004-03-23 23:52 ` [Bug c/12391] [3.4 " zack at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-03-16 20:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From zack at gcc dot gnu dot org 2004-03-16 20:57 -------
Fixed by the c-decl.c rewrite:
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg01280.html
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12391
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/12391] [3.4 regression] missing warning about assigning to an incomplete type
2003-09-24 18:36 [Bug c/12391] New: regression: missing warning about assigning to an incomplete type levon at movementarian dot org
` (3 preceding siblings ...)
2004-03-16 20:57 ` zack at gcc dot gnu dot org
@ 2004-03-23 23:52 ` zack at gcc dot gnu dot org
2004-06-01 4:25 ` zack at gcc dot gnu dot org
2004-06-09 19:21 ` mmitchel at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-03-23 23:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From zack at gcc dot gnu dot org 2004-03-23 23:52 -------
fixed in 3.5
--
What |Removed |Added
----------------------------------------------------------------------------
Known to work|3.3 |3.3 3.5.0
Summary|[3.4/3.5 regression] missing|[3.4 regression] missing
|warning about assigning to |warning about assigning to
|an incomplete type |an incomplete type
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12391
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/12391] [3.4 regression] missing warning about assigning to an incomplete type
2003-09-24 18:36 [Bug c/12391] New: regression: missing warning about assigning to an incomplete type levon at movementarian dot org
` (4 preceding siblings ...)
2004-03-23 23:52 ` [Bug c/12391] [3.4 " zack at gcc dot gnu dot org
@ 2004-06-01 4:25 ` zack at gcc dot gnu dot org
2004-06-09 19:21 ` mmitchel at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-06-01 4:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From zack at gcc dot gnu dot org 2004-06-01 04:25 -------
Suspending bugs which could be fixed by backporting the c-decl.c rewrite to 3.4.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |SUSPENDED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12391
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/12391] [3.4 regression] missing warning about assigning to an incomplete type
2003-09-24 18:36 [Bug c/12391] New: regression: missing warning about assigning to an incomplete type levon at movementarian dot org
` (5 preceding siblings ...)
2004-06-01 4:25 ` zack at gcc dot gnu dot org
@ 2004-06-09 19:21 ` mmitchel at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-06-09 19:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-06-09 19:20 -------
Fixed in 3.5, won't be fixed in 3.4.x.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|SUSPENDED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12391
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-06-09 19:21 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-24 18:36 [Bug c/12391] New: regression: missing warning about assigning to an incomplete type levon at movementarian dot org
2003-09-24 20:40 ` [Bug c/12391] [3.4 regression] " bangerth at dealii dot org
2003-12-19 6:37 ` pinskia at gcc dot gnu dot org
2004-02-28 2:35 ` [Bug c/12391] [3.4/3.5 " mmitchel at gcc dot gnu dot org
2004-03-16 20:57 ` zack at gcc dot gnu dot org
2004-03-23 23:52 ` [Bug c/12391] [3.4 " zack at gcc dot gnu dot org
2004-06-01 4:25 ` zack at gcc dot gnu dot org
2004-06-09 19:21 ` mmitchel at gcc dot gnu dot 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).