aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2019-07-26 18:21:30 +0200
committerPali Rohár <pali.rohar@gmail.com>2019-07-26 18:21:30 +0200
commitff3026745272b9aa61731ee4150735e2c5cfcb70 (patch)
tree0c96b5b7df91d6dacbeee6e5fbcb283793b68dbb
parent2bb5f487922aa908d27175c5a562d34f4c6197d9 (diff)
downloaddlfcn-win32-ff3026745272b9aa61731ee4150735e2c5cfcb70.tar.gz
dlfcn-win32-ff3026745272b9aa61731ee4150735e2c5cfcb70.tar.bz2
dlfcn-win32-ff3026745272b9aa61731ee4150735e2c5cfcb70.zip
Fix more gcc warnings
ISO C90 forbids mixed declarations and code ISO C++ forbids converting a string constant to 'char*'
-rw-r--r--test.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/test.c b/test.c
index 798ab08..aa0e0f1 100644
--- a/test.c
+++ b/test.c
@@ -253,9 +253,11 @@ int main()
253 } 253 }
254 else 254 else
255 printf( "SUCCESS\tGot symbol from global handle: %p\n", *(void **) (&fwrite_local) ); 255 printf( "SUCCESS\tGot symbol from global handle: %p\n", *(void **) (&fwrite_local) );
256 char * hello_world = "Hello world from local fwrite!\n"; 256 {
257 fwrite_local(hello_world,sizeof(char),strlen(hello_world),stderr); 257 const char *hello_world = "Hello world from local fwrite!\n";
258 fflush(stderr); 258 fwrite_local( hello_world, sizeof( char ), strlen( hello_world ), stderr );
259 fflush( stderr );
260 }
259 261
260 *(void **) (&fputs_default) = dlsym( RTLD_DEFAULT, "fputs" ); 262 *(void **) (&fputs_default) = dlsym( RTLD_DEFAULT, "fputs" );
261 if (!fputs_default) 263 if (!fputs_default)
@@ -269,9 +271,11 @@ int main()
269 } 271 }
270 else 272 else
271 printf( "SUCCESS\tGot symbol from default handle: %p\n", *(void **) (&fputs_default) ); 273 printf( "SUCCESS\tGot symbol from default handle: %p\n", *(void **) (&fputs_default) );
272 char * hello_world_fputs = "Hello world from default fputs!\n"; 274 {
273 fputs_default(hello_world_fputs, stderr); 275 const char *hello_world_fputs = "Hello world from default fputs!\n";
274 fflush(stderr); 276 fputs_default( hello_world_fputs, stderr );
277 fflush( stderr );
278 }
275 279
276 *(void **) (&function) = dlsym( library, "function" ); 280 *(void **) (&function) = dlsym( library, "function" );
277 if( !function ) 281 if( !function )