gcc v3.0.1 vs gcc v2.95.3 -- KDE 2.2.1

v13 at priest.com v13 at priest.com
Thu Nov 29 19:23:01 EET 2001


On Thursday 29 November 2001 17:46, Dimitris Moraitis wrote:

> Den einai thema leitourgikou.
> H main einai mia synarthsh pou epistrefei int. To grafei rhta sto ANSI 
> standard.
> To void main() einai undefined behavior. Kapoioi compilers borei na to 
> dexontan edo kai kairo gia na einai symvatoi me ta diafora vitsia pou eixan 
> oi programmatistes thn pro ANSI epoxh alla pleon exoume 2001, 12 xronia 
> meta to ANSI 89. Opote einai logiko pleon oi compilers na asxolountai me to 
> ti einai C kai oxi me to ti moiazei me C. Afto tous epitrepei na kanoun kai 
> perissotera optimizations.

$ cat a.cc
int main(char *p)
{
}

void main(int n)
{
}

$ g++ a.cc
a.cc:6: `main' must return `int'
a.cc: In function `int main(...)':
a.cc:6: declaration of C function `int main(...)' conflicts with
a.cc:2: previous declaration `int main(char*)' here

Gia prospathise na moy eksigiseis to parapano. 
Den tha eprepe na ginei compile? Kai ektos aytoy, ante bgale
akri apo to error message, poy leei oti yparxoyn 2 "int main()"

An eprepe na einai lathos, tote aplos eprepe na leei oti den
yparxei h "int main()" (otan exei dilothi mono "void main()" kai
oxi oti 'prepei na einai etsi'

> Dimitris
<<V13>>

p.s. Ta parapano apoteloyn prosopiki apopsi kai se kamia periptosi den
     ekfrazoyn/apoteloyn episimi dilosi toy eaytoy moy.




More information about the Linux-greek-users mailing list