Bug 2970 - libsmb/clirap2.c: PUTSTRING "controlling expression is constant"
libsmb/clirap2.c: PUTSTRING "controlling expression is constant"
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.20
SGI IRIX
: P3 normal
: none
Assigned To: James Peach
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-09 09:09 UTC by Jason Mader
Modified: 2006-06-23 01:15 UTC (History)
0 users

See Also:


Attachments
delete semicolon (757 bytes, patch)
2005-08-09 09:35 UTC, Jason Mader
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Mader 2005-08-09 09:09:15 UTC
cc-1209 cc: WARNING File = libsmb/clirap2.c, Line = 1573
  The controlling expression is constant.

    PUTSTRING(p, RAP_SMB_PRINT_JOB_L1, 0);
    ^

cc-1209 cc: WARNING File = libsmb/clirap2.c, Line = 1678
  The controlling expression is constant.

    PUTSTRING(p, RAP_SMB_PRINT_JOB_L1, 0);
    ^
Comment 1 Jason Mader 2005-08-09 09:28:52 UTC
One note, the PUTSTRINGP macro in this file ends with a semicolon, while the
other macros do not.  That might be a mistake.
Comment 2 Jason Mader 2005-08-09 09:35:22 UTC
Created attachment 1361 [details]
delete semicolon

change spacing for consistency
Comment 3 Jason Mader 2005-08-09 09:42:53 UTC
This warning is interesting because the MIPSpro compiler reports this warning
only for these two occurances of the PUTSTRING macro, when other macros such as
PUTWORD that use the same do {} while(0) construction don't produce any warning.
 James Peach may be interested in this.
Comment 4 Jason Mader 2005-08-09 10:32:10 UTC
In a test program the MIPSpro compiler does not generate a warning.  -Wall will
produce a REMARK though, as expected.
Comment 5 Jason Mader 2005-08-09 10:51:35 UTC
Here is the do loop block after being run through the pre-processor:

  do {
    push_ascii(p,"WB21BB16B10zWWzDDz"?"WB21BB16B10zWWzDDz":"",0?0:256,1);
    p = skip_string(p,1);
  } while(0);


And the Warning recreated in a test program:

The controlling expression is constant.

      push_ascii(p,"WB21BB16B10zWWzDDz"?"WB21BB16B10zWWzDDz":"",0?0:256,1);
                   ^
Comment 6 James Peach (outdated mail address) 2005-09-11 18:30:50 UTC
(In reply to comment #5)
> Here is the do loop block after being run through the pre-processor:
> 
>   do {
>     push_ascii(p,"WB21BB16B10zWWzDDz"?"WB21BB16B10zWWzDDz":"",0?0:256,1);
>     p = skip_string(p,1);
>   } while(0);

This is a common enough idiom, that I just turn that warning off. Use 
-woff 1209 for mipspro.

I'm inclined to mark this as WONTFIX.
Comment 7 James Peach (outdated mail address) 2006-06-23 01:15:11 UTC
Fixed in 16483, by using -woff 1209 by default.