This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

[Michal Moskal <malekith@pld.org.pl>] libc/1931: gconv.h uses array of size [0], ANSI C complier cannot compile hello.c



We've received the appended bug report.  Here's a fix.  Ok to commit?

Andreas

2000-11-27  Andreas Jaeger  <aj@suse.de>

	* iconv/gconv.h (__gconv_info): Don't use zero sized array for non
	GCC compilers.
	Closes PR libc/1931, reported by Michal Moskal <malekith@pld.org.pl>.

============================================================
Index: iconv/gconv.h
--- iconv/gconv.h	2000/11/20 08:49:09	1.26
+++ iconv/gconv.h	2000/11/27 10:34:02
@@ -168,7 +168,11 @@
 {
   size_t __nsteps;
   struct __gconv_step *__steps;
+# ifdef __GNUC__  
   __extension__ struct __gconv_step_data __data[0];
+# else
+  struct __gconv_step_data *__data [1];
+# endif
 } *__gconv_t;
 
 #endif /* gconv.h */

Subject: Topics

Topics:
   libc/1931: gconv.h uses array of size [0], ANSI C complier cannot compile hello.c



>Number:         1931
>Category:       libc
>Synopsis:       array of size 0 in gconv.h (possibly somewhere else)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    libc-gnats
>State:          open
>Quarter:        
>Keywords:       
>Class:          change-request
>Submitter-Id:   unknown
>Arrival-Date:   Fri Nov 24 09:55:01 -0500 2000
>Cases:          
>Originator:     Micha³ Moskal
>Release:        libc-2.2
>Organization:
  
  In gconv.h line 171, there is an definition of array of size
  0 w/o #ifdef __GCC__ so i connot complile simopliest hello world
  with stdio.h included usign lcc.
  
                               Micha³ Moskal <malekith@pld.org.pl>
  
  5191204625270805457964695575480234779108160500582132743089099204
  5387169364764370076473597425941183680741973762154745366983057996
  3022327445184252093714797111892347913483105724113222069964409702
  905357106994771308266205
>
>Environment:
possibly any linux with 2.2 glibc
Not relevant:
Host type: sparc-pld-linux-gnu
System: Linux team 2.2.16-3 #1 Mon Jun 19 20:41:27 EDT 2000 sparc64 pld
Architecture: sparc64

Addons: linuxthreads
Build CFLAGS: -O2 -m32 -mtune=ultrasparc
Build CC: gcc
Compiler version: 2.95.3 19991030 (prerelease)
Kernel headers: 2.2.18pre23
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: yes
Build omitfp: no
Build bounded: no
Build static-nss: no
Stdio: libio

>Description:
  In gconv.h line 171, there is an definition of array of size
  0 w/o #ifdef __GCC__ so i connot complile simopliest hello world
  with stdio.h included usign lcc.
>How-To-Repeat:
  Compile
  #include <stdio.h>
  main(){printf("hello world\n");}
  with lcc on x86.
>Fix:
	#ifdef _GCC_ sucker.






-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

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