C problem...se megethos domhs

V13 v13 at priest.com
Sun Jan 25 15:12:54 EET 2004


On Sunday 25 January 2004 04:13, John Tsiombikas (Nuclear / the Lab) wrote:
> void foo();
>
> int main(void) {
>      foo();
>      return 0;
> }
>
> void foo(void (*bar)()) {
>      bar();
> }
>
> kai pes mou pou tha pidiksei :)

H C den prostateve pote apo lathos kliseis... p.x. to parakato programma einai 
'sosto' :

int main(void)
{
	fopen();
	fprintf("koko%s", "lala");
}

> [1] Alla exe ypopsin sou oti to standard tis C den perigrafei to pos
> kaleite i synartisi, px se merikes arxitektonikes oi parametroi den pernane
> sto stack alla se registers, i den apeteite kan i yparksi stack (an mporei
> to implementation na kanei oti prepei na kanei kai xoris stack). Genikos i
> C kathorizei symperifora, oxi implementation.

Sto C calling convention oles oi parametroi pernane stin stiba ektos kai an 
milame gia inline functions h tipota trela optimizations. AFAIK ayto poy 
perigrafeis einai extension orismenon compilers (p.x. borland opoy 
epitygxanetai me to __fastcall) to opoio pernaei tis protes 1-2 parametroys 
se kataxorites.

To na pernas parametroys se kataxorites einai genika kakh idea, ektos kai an 
eisai sigoyros oti se mia sygkekrimeni periptosi kati tetoio tha boithisei... 
Ayto isxyei gia poly mikres functions oi opoies einai protimotero na ginontai 
inline (kai fysika den milame gia synartiseis poy anikoyn se bibliothikes 
mias kai to perasma parametron se kataxorites apokliei kati tetoio)

> -- Nuclear / the Lab --
<<V13>>




More information about the Linux-greek-users mailing list