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]

strange warning in gsl_matrix_float_set


i have a wired problem. independently of wether i declare val as float or as double
i get the warning below for the following code:

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

void read_as_int(gsl_matrix_float *m, size_t n1, size_t n2)
{
	int c1, c2;
	double val;  /* or float val */
	size_t i, j;
	
	for(i=0; i< n1; i++) {
		for(j=0; j<n2; j++) {
			c1=fgetc(stdin);
			c2=fgetc(stdin);
			val=c1 + 256.0*c2;
			gsl_matrix_float_set(m, i, j, val);
		}
	}
}


gcc -O2 -march=i386 -mcpu=i686 -pipe -pedantic -Wall -W -Wmissing-prototypes
 -Wstrict-prototypes -Wtraditional -Wconversion -Wshadow -Wpointer-arith
 -Wcast-qual -Wcast-align -Wwrite-strings -fshort-enums -fno-common -Wnested-externs 
 -Dinline= -g     -I/usr/X11R6/include    -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L 
 -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE     -DFUNCPROTO=15 -DNARROWPROTO
 -c -o read_as_int.o read_as_int.c
read_as_int.c: In function `read_as_int':
read_as_int.c:14: warning: passing arg 4 of `gsl_matrix_float_set' as `float' rather 
than `double' due to prototype
rm -f lav2pnm
gcc -o lav2pnm -O2 -march=i386 -mcpu=i686 -pipe -pedantic -Wall -W -Wmissing-prototypes
 -Wstrict-prototypes -Wtraditional -Wconversion -Wshadow -Wpointer-arith
 -Wcast-qual -Wcast-align -Wwrite-strings -fshort-enums -fno-common -Wnested-externs
 -Dinline= -g     -L/usr/X11R6/lib lav2pnm.o      read_as_int.o      write_pgm.o      
 write_ppm.o      HSV_to_RGB.o      help.o      -lgsl -lgslcblas -lm 

what am i doing wrong here?
-- 
Dr. Ivo Alxneit
Laboratory for Solar Technology   phone: +41 56 310 4092
CH-5232 Villigen                    fax: +41 56 310 2624
Paul Scherrer Institute          http://solar.web.psi.ch
Switzerland                        gnupg key: 0x515E30C7

Attachment: msg00030/pgp00000.pgp
Description: PGP signature


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