public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/11250] -pedantic accepts `char a[] = ("x");'
       [not found] <20030619113424.11250.h.b.furuseth@usit.uio.no>
@ 2003-07-05 21:21 ` neroden at gcc dot gnu dot org
  2003-07-18 22:57 ` dhazeghi at yahoo dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: neroden at gcc dot gnu dot org @ 2003-07-05 21:21 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=11250


neroden at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-05 21:21:42
               date|                            |


------- Additional Comments From neroden at gcc dot gnu dot org  2003-07-05 21:21 -------
Confirmed in mainline.  Gee, this is truly pedantic, though, so setting severity to "minor".


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/11250] -pedantic accepts `char a[] = ("x");'
       [not found] <20030619113424.11250.h.b.furuseth@usit.uio.no>
  2003-07-05 21:21 ` [Bug c/11250] -pedantic accepts `char a[] = ("x");' neroden at gcc dot gnu dot org
@ 2003-07-18 22:57 ` dhazeghi at yahoo dot com
  2003-09-08  7:27 ` ebotcazou at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-07-18 22:57 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=11250


dhazeghi at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
   Last reconfirmed|2003-07-05 21:21:42         |2003-07-18 22:57:23
               date|                            |


------- Additional Comments From dhazeghi at yahoo dot com  2003-07-18 22:57 -------
Reconfirmed with mainline.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/11250] -pedantic accepts `char a[] = ("x");'
       [not found] <20030619113424.11250.h.b.furuseth@usit.uio.no>
  2003-07-05 21:21 ` [Bug c/11250] -pedantic accepts `char a[] = ("x");' neroden at gcc dot gnu dot org
  2003-07-18 22:57 ` dhazeghi at yahoo dot com
@ 2003-09-08  7:27 ` ebotcazou at gcc dot gnu dot org
  2004-07-21 23:46 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2003-09-08  7:27 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=11250


ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|sparc-sun-solaris2.8        |
   GCC host triplet|sparc-sun-solaris2.8        |
 GCC target triplet|sparc-sun-solaris2.8        |


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2003-09-08 07:27 -------
Generic C front-end problem.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/11250] -pedantic accepts `char a[] = ("x");'
       [not found] <20030619113424.11250.h.b.furuseth@usit.uio.no>
                   ` (2 preceding siblings ...)
  2003-09-08  7:27 ` ebotcazou at gcc dot gnu dot org
@ 2004-07-21 23:46 ` cvs-commit at gcc dot gnu dot org
  2004-07-22  0:18 ` pinskia at gcc dot gnu dot org
  2004-10-28  9:15 ` pere at hungry dot com
  5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-07-21 23:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-07-21 23:46 -------
Subject: Bug 11250

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jsm28@gcc.gnu.org	2004-07-21 23:46:21

Modified files:
	gcc            : ChangeLog c-parse.in c-tree.h c-typeck.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: init-string-1.c 

Log message:
	PR c/11250
	* c-parse.in (init): Change to exprtype.
	(primary): Set original_code for STRING to STRING_CST.
	Call maybe_warn_string_init for compound literals.
	(initdcl, notype_initdcl): Call maybe_warn_string_init.
	(initval): Update.
	* c-tree.h (maybe_warn_string_init): New.
	(pop_init_level, process_init_element): Use struct c_expr.
	(struct c_expr): Update comment.
	* c-typeck.c (maybe_warn_string_init): New function.
	(digest_init): Call it.  Additional parameter strict_string.  All
	callers changed.
	(output_init_element): Likewise.
	(struct constructor_stack): Use struct c_expr for
	replacement_value.
	(really_start_incremental_init, push_init_level): Update.
	(pop_init_level): Update.  Return struct c_expr.
	(process_init_level): Update.  Take struct c_expr argument.
	
	testsuite:
	* gcc.dg/init-string-1.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4627&r2=2.4628
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-parse.in.diff?cvsroot=gcc&r1=1.223&r2=1.224
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-tree.h.diff?cvsroot=gcc&r1=1.164&r2=1.165
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.343&r2=1.344
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4031&r2=1.4032
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/init-string-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/11250] -pedantic accepts `char a[] = ("x");'
       [not found] <20030619113424.11250.h.b.furuseth@usit.uio.no>
                   ` (3 preceding siblings ...)
  2004-07-21 23:46 ` cvs-commit at gcc dot gnu dot org
@ 2004-07-22  0:18 ` pinskia at gcc dot gnu dot org
  2004-10-28  9:15 ` pere at hungry dot com
  5 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-22  0:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-22 00:17 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.5.0


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/11250] -pedantic accepts `char a[] = ("x");'
       [not found] <20030619113424.11250.h.b.furuseth@usit.uio.no>
                   ` (4 preceding siblings ...)
  2004-07-22  0:18 ` pinskia at gcc dot gnu dot org
@ 2004-10-28  9:15 ` pere at hungry dot com
  5 siblings, 0 replies; 6+ messages in thread
From: pere at hungry dot com @ 2004-10-28  9:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pere at hungry dot com  2004-10-28 09:15 -------
The compiler on IA64/HP-UX (aCC: HP aC++/ANSI C B3910B A.05.50 [May 15 2003])
refuses to compile this code and gives this error message:

  Error 271: "x.c", line 1 # Illegal initializer.
      char a[] = ("x");
                 ^^^^^

It would be good if GCC always gave a warning (or even an error) if this
code is illegal according to ANSI C, to warn people that this code will fail
to compile on other compilers.


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-10-28  9:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20030619113424.11250.h.b.furuseth@usit.uio.no>
2003-07-05 21:21 ` [Bug c/11250] -pedantic accepts `char a[] = ("x");' neroden at gcc dot gnu dot org
2003-07-18 22:57 ` dhazeghi at yahoo dot com
2003-09-08  7:27 ` ebotcazou at gcc dot gnu dot org
2004-07-21 23:46 ` cvs-commit at gcc dot gnu dot org
2004-07-22  0:18 ` pinskia at gcc dot gnu dot org
2004-10-28  9:15 ` pere at hungry dot com

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).