From: bernhard@alpha1.csd.uwm.edu (Bernhard Reiter)
Subject: Dec C pecularity
Date: 1999/06/09 [thread overview]
Message-ID: <slrn7lrmsn.q92.bernhard@alpha1.csd.uwm.edu> (raw)
While compiling mutt-0.95.6i on
OSF1 V4.0 878 alpha
using DEC C V5.6-079 on Digital UNIX V4.0 (Rev. 878)
I encountered a difference between gnu c and Dec c.
Wheather this is a bug or not, I can't say, but at least it
is a pitfall.
Consider the following program, Dec C doesn't like the y definition:
#include <stdio.h>
char x[]="\
Hi\n Here is more\n\
Wolw\n";
char y[]=("Hi there");
int main(void){
printf("%s",x);
return 0;
}
alpha1 mutt-0.95.6 166: gcc -pedantic -ansi -Wall probe.c
alpha1 mutt-0.95.6 167: cc probe.c
cc: Warning: probe.c, line 7: In the initializer for y[0], "("Hi there")" has a
larger data size than "signed char". Assignment may result in data loss.
char y[]=("Hi there");
---------^
cc: Warning: probe.c, line 7: In the initializer for y[0], "("Hi there")" of typ
e "pointer to signed char", is being converted to "signed char".
char y[]=("Hi there");
---------^
cc: Error: probe.c, line 7: In the static initialization, the address cannot be
converted to the destination type.
char y[]=("Hi there");
---------^
alpha1 mutt-0.95.6 168: cc -std1 probe.c
cc: Error: probe.c, line 7: In the initializer for y a required set of braces is
missing.
char y[]=("Hi there");
---------^
Cheers,
Bernhard
--
Research Assistant, Geog Dept UM-Milwaukee, USA. (www.uwm.edu/~bernhard)
Funding/Promoting Association for a Free Informational Infrastructure (ffii.org)
next reply other threads:[~1999-06-09 4:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-09 4:00 Bernhard Reiter [this message]
1999-06-11 4:00 ` Dec C pecularity Jeff Sullivan
1999-06-13 4:00 ` Tobias Ernst
1999-06-14 4:00 ` Peter da Silva
1999-06-26 4:00 ` Tobias Ernst
1999-06-29 4:00 ` Charles M Richmond
1999-07-13 4:00 ` Tobias Ernst
1999-07-13 4:00 ` Charles M Richmond
1999-07-13 4:00 ` Kevin Oberman
1999-07-14 4:00 ` T.E.Dickey
1999-07-15 4:00 ` libcurses and patches for 4.0 jhitchcock
1999-07-16 4:00 ` T.E.Dickey
1999-08-10 4:00 ` b_andreasen
1999-07-16 4:00 ` Dec C pecularity Tobias Ernst
1999-07-18 4:00 ` T.E.Dickey
1999-07-14 4:00 ` T.E.Dickey
1999-06-22 4:00 ` Jeff Sullivan
1999-06-22 4:00 ` Jeff Sullivan
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox