Bonjour à tous,
J'ai un petit problème à l'exécution de mon programme.
Voici ma fonction:
Le "void *type" est en fait un string, mon problème est que lorsque je le compile avec gcc, lors de l'exécution, j'ai un "segmentation fault":
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
#0 0x2819cf9c in strlen () from /lib/libc.so.7
#1 0x28195906 in open () from /lib/libc.so.7
#2 0x0000000e in ?? ()
#3 0x000000a5 in ?? ()
#4 0x2806df2c in _rtld_error () from /libexec/ld-elf.so.1
#5 0x28196a1b in vfprintf () from /lib/libc.so.7
#6 0x28183643 in printf () from /lib/libc.so.7
#7 0x08048ce4 in lps_onVarDeclType (this=0x0, type=0xe) at src/ast.c:331
#8 0x0804ce5a in yy_11_ConventionalVarDecl (G=0x28404060, yytext=0x28493000 "Int", yyleng=3, thunk=0x284d71b0, core=0x28406000) at src/lps.c:3244
#9 0x08049d2d in yyDone (G=0x28404060) at src/lps.c:556
#10 0x08066564 in yyparse_from (G=0x28404060, yystart=0x80662fb <yy_Module>) at src/lps.c:8161
#11 0x0806658d in yyparse (G=0x28404060) at src/lps.c:8181
#12 0x08066753 in lps_parse (this=0x0, path=0x80667ef "test/test.ooc") at src/lps.c:8229
#13 0x08048791 in main () at src/main.c:5
Celui-ci est censé imprimer dans la console: "lps_onVarDeclType: Int" mais ce n'est pas le cas, alors que si je compile mon programme avec le compilateur "clang", tout fonctionne.
Ma question est donc, y a-t-il quelque chose à faire "en plus" pour convertir un pointer en string avec gcc ?
Merci d'avance pour votre réponse,
Cordialement,
Nicolas.

 

 
		
		 
        

 
			
			


 
   
 


 Problème pointer/string avec gcc
 Problème pointer/string avec gcc
				 Répondre avec citation
  Répondre avec citation


 
  
 
 
			![Avatar de D[r]eadLock Avatar de D[r]eadLock](https://www.developpez.net/forums/avatars/1944-d-r-eadlock.gif?dateline=1166375583) 
			 Envoyé par nikobordx
 Envoyé par nikobordx
					
Partager