This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gsl and gcc -Wconversion


Hello List,

recently I add compilation option as it is explained in the GSL Manual to build one of my stuff:
I have noticed that the option -Wconversion (gcc) produces the warning message

warning: passing arg 4 of `gsl_matrix_char_set' with different width due to prototype

when the fourth is an expected (const char).

The attached program does reproduce this warning with different gcc compiler (gcc 2.95, gcc-3.[234])
on my Debian (Sarge) Pentium 4M box (i686).

Does I miss something ?

Jerome

// gcc -o bogus_gsl_matrix_char bogus_gsl_matrix_char.c $(gsl-config --cflags --libs) -Wconversion
// ./bogus_gsl_matrix_char

#include <stdio.h>
#include <gsl/gsl_matrix_char.h>

#define ADHOC_MATRIX_SIZE 5

int
main (void){
	gsl_matrix_char * m=NULL;
	size_t idx,idy,idz;

	m=gsl_matrix_char_calloc(ADHOC_MATRIX_SIZE,ADHOC_MATRIX_SIZE);

	idx=2%ADHOC_MATRIX_SIZE;
	idy=3%ADHOC_MATRIX_SIZE;
	idz=4%ADHOC_MATRIX_SIZE;

	gsl_matrix_char_set(m,idx,idy,1);
	gsl_matrix_char_set(m,idy,idx,'@');
	gsl_matrix_char_set(m,idx,idz,(const char)(1));

	gsl_matrix_char_fprintf(stdout,m,">> %d");
				
  return 0; }
bogus_gsl_matrix_char.c: In function `main':
bogus_gsl_matrix_char.c:20: warning: passing arg 4 of `gsl_matrix_char_set' with different width due to prototype
bogus_gsl_matrix_char.c:21: warning: passing arg 4 of `gsl_matrix_char_set' with different width due to prototype
bogus_gsl_matrix_char.c:22: warning: passing arg 4 of `gsl_matrix_char_set' with different width due to prototype

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]