[torqueusers] Compile problem with the latest Torque snapshot versions

Lennart Karlsson Lennart.Karlsson at nsc.liu.se
Fri Mar 31 08:23:05 MST 2006


Torque version:	torque-2.1.0p0-snap.200603221901
File:		attr_fn_resc.c
Function:	comp_resc2

---------- Some lines of the abovementioned function ----------
int comp_resc2(

  struct attribute *attr,           /* I queue's min/max attributes */
  struct attribute *with,           /* I job's current requirements/attributes 
*/
  int               IsQueueCentric, /* I */
  char             *EMsg)           /* O (optional,minsize=1024) */

  {
  resource *atresc;
  resource *wiresc;
  int rc;

  comp_resc_gt = 0;
  comp_resc_eq = 0;
  comp_resc_lt = 0;
  comp_resc_nc = 0;

  char *LimitName;
-----------------------------------------------------------------------

Compiler:	gcc-2.96

Error output:
attr_fn_resc.c: In function `comp_resc2':
attr_fn_resc.c:505: parse error before `char'
attr_fn_resc.c:540: `LimitName' undeclared (first use in this function)
attr_fn_resc.c:540: (Each undeclared identifier is reported only once
attr_fn_resc.c:540: for each function it appears in.)
make: *** [attr_fn_resc.o] Error 1


Line 505 is the *LimitName declaration.

My guess is that the programmer does not follow the old rule: "The 
declarations,
if any, must occur before the statements."

Yes, this does compile on later versions of gcc. Still, I would be
thankful for an adaption to the old ways.

Thanks,
-- Lennart Karlsson <Lennart.Karlsson at nsc.liu.se>
   National Supercomputer Centre in Linkoping, Sweden
   http://www.nsc.liu.se




More information about the torqueusers mailing list