Article View: alt.comp.lang.learn.c-c++
Article #781Re: Pb de Cast
From: Apple
Date: Thu, 23 Dec 1999 00:00
Date: Thu, 23 Dec 1999 00:00
31 lines
1911 bytes
1911 bytes
J'utilise gcc 2.95.x et j'ai un probl�me de cast en c++/c
j'ai une fonction qui renvoie un void * (fct syst�me) mais c'est en r�alit�
un pointeur sur une fonction:
La pr�c�dente version de gcc me mettait un warning sur l'affectation d'un
void * en autre chose
mais la nouvelle version fait une erreur !!!
voici le bout de code :
void mafct()
{
void *hfile;
char *(*name)();
hfile=dlopen("lib.so",RTLD_LAZY);
if (!hfile)
{
printf("%s\n",dlerror());
return;
}
name=dlsym(hfile,"PlugInName"); // cette fct renvoie un void *
comment
le caster en char * (*)
// Elle
recupere dans une lib une fonction et renvoie un poiteur sur cette fct !!!
---------------------------------------------------------------------------
-------------------------------
gin@wanadoo.fr
Like Sybase Central LSC http://perso.wanadoo.fr/laserquest/linux
Technical Details
Message-ID:
<83u276$tb$1@wanadoo.fr>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: fdcad,902d1c07f4488079 X-Google-Attributes: gidfdcad,public X-Google-Thread: 1014db,7f00a62cd7dca919,start X-Google-Attributes: gid1014db,public X-Google-Thread: 114592,7f00a62cd7dca919,start X-Google-Attributes: gid114592,public X-Google-Thread: f9822,f22d8660832eaded X-Google-Attributes: gidf9822,public From: "Apple" <gin@wanadoo.fr> Subject: Re: Pb de Cast Date: 1999/12/23 Message-ID: <83u276$tb$1@wanadoo.fr> X-Deja-AN: 564314430 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: abuse@wanadoo.fr X-Trace: wanadoo.fr 945982502 939 193.250.83.79 (23 Dec 1999 20:55:02 GMT) Organization: Wanadoo, l'internet avec France Telecom X-MSMail-Priority: Normal NNTP-Posting-Date: 23 Dec 1999 20:55:02 GMT Newsgroups: alt.comp.lang.learn.c-c++,comp.lang.c,fr.comp.lang.c,fr.comp.lang.c++