[gmx-users] wrong with new variables
David
spoel at xray.bmc.uu.se
Fri Sep 3 20:08:07 CEST 2004
On Fri, 2004-09-03 at 19:44, Nguyen Hoang Phuong wrote:
> Dear All,
>
> for some reason, I define the new variables in the pdihs of bondfree.c
> like this
>
> real pdihs(int nbonds,
> t_iatom forceatoms[],t_iparams forceparams[],
> rvec x[],rvec f[],t_forcerec *fr,t_graph *g,
> matrix box,real lambda,real *dvdlambda,
> t_mdatoms *md,int ngrp,real egnb[],real egcoul[],
> t_fcdata *fcd)
> {
>
> int i,type,ai,aj,ak,al;
> rvec r_ij,r_kj,r_kl,m,n;
> real phi,cos_phi,sign,ddphi,vpd,vtot;
> real temp,beta,scale,qqq,epsilon; <-----my variables
>
> when I run
>
> make
>
> I got this
>
> warning: `temp' might be used uninitialized in this function
> bondfree.c:715: warning: `qqq' might be used uninitialized in this
> function
> bondfree.c:715: warning: `epsilon' might be used uninitialized in this
> function
The compiler is warning you that you are doing something like
a = b
without prior assigning something to b.
Often howver you have code like:
if (X)
b = 3;
more
if (X)
a = b;
which is correct, but the compiler cannot understand the logic and warns
you.
> make[3]: *** [bondfree.lo] Error 1
>
> Does anyone know what is wrong here?
>
> thanks,
>
> Phuong
>
> _______________________________________________
> gmx-users mailing list
> gmx-users at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-users
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-users-request at gromacs.org.
--
David.
________________________________________________________________________
David van der Spoel, PhD, Assoc. Prof., Molecular Biophysics group,
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596, 75124 Uppsala, Sweden
phone: 46 18 471 4205 fax: 46 18 511 755
spoel at xray.bmc.uu.se spoel at gromacs.org http://xray.bmc.uu.se/~spoel
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
More information about the gromacs.org_gmx-users
mailing list