07 Aug, 2007, Sanami wrote in the 1st comment:
Votes: 0
change.c: In function 'do_change':
change.c:522: warning: comparison with string literal results in unspecified behaviour
change.c:522: warning: comparison with string literal results in unspecified behaviour
change.c:522: warning: comparison with string literal results in unspecified behaviour


time_t time_n;
char fst[MAX_STRING_LENGTH];
char sst[MAX_STRING_LENGTH];

time_n = current_time + (60*60*24*180);
act(AT_BLUE, "$t", ch, ctime(&time_n), NULL, TO_CHAR);
strcpy(fst, ctime(&time_n));
strcpy(sst, fst + 11);
sst[8] = '\0';
send_to_char(AT_BLUE,sst,ch);
(522)—> sprintf(fst, "\n\r%d %d %d", ("aA" < "aB"), ("Aa" > "aB"), ("A" < b"));
send_to_char(AT_BLUE,fst,ch);
return;
}

if ( !str_cmp( arg, "list" ) )
{
char arg1[MAX_STRING_LENGTH];
char arg2[MAX_STRING_LENGTH];
int fn = 0;
int ln = 0;


Please help. Sorry if this seems novice.
07 Aug, 2007, Guest wrote in the 2nd comment:
Votes: 0
Well. My first thought here would be exactly what does
sprintf(fst, "\n\r%d %d %d", ("aA" < "aB"), ("Aa" > "aB"), ("A" < b"));

do? It looks like nonsense to me. Do you happen to know what the purpose of this statement is?

The warning message itself seems to indicate the compiler believes it to be nonsense as well.
07 Aug, 2007, Sanami wrote in the 3rd comment:
Votes: 0
Well the the same happens in act_comm.c on line 568 in do_note. Both are forms of note systems. Here is the act_comm file pretty much the same.
Link to act_comm.c of EotS
07 Aug, 2007, Darwin wrote in the 4th comment:
Votes: 0
I think the error "comparison with string literal" is referring to the last part of that line that reads
Quote
("A" < b")
as it is missing a double quote around the b. You are comparing a string literal "A" to an unknown b".
You probably just need to add a double quote around the b as that is the same way it looks in the link to act_comm.c you provided.

I have to agree with Samson though. This line doesn't seem to do anything because there is nothing that will change the outcome of those evaluations since they are hard-coded string literals.
07 Aug, 2007, Davion wrote in the 5th comment:
Votes: 0
I'm slightly confused as to what is trying to be accomplished there. I could understand if you're comparing individual characters
if('a' > 'b')


But using string literals would simply compare address, wouldn't it?
07 Aug, 2007, Guest wrote in the 6th comment:
Votes: 0
Heh. I didn't even notice the actual syntax error. Still doesn't change the fact that whatever this statement is supposed to do is a mystery.
07 Aug, 2007, Keberus wrote in the 7th comment:
Votes: 0
This is a snippet from the act_comm.c file above which seems to imply (at least in my opinion) that the coder was testing to make sure he knew the results of the character comparisons, as well as check the output of a few other things. I think it was more or less for the coder's own pre-check, and he forgot to remove it.

Here's the code:
if ( !str_cmp( arg, "test" ) )    
{
time_t time_n;
char fst[MAX_STRING_LENGTH];
char sst[MAX_STRING_LENGTH];

time_n = current_time + (60*60*24*180);
act(AT_BLUE, "$t", ch, ctime(&time_n), NULL, TO_CHAR);
strcpy(fst, ctime(&time_n));
strcpy(sst, fst + 11);
sst[8] = '\0';
send_to_char(AT_BLUE,sst,ch);
sprintf(fst, "\n\r%d %d %d", ("aA" < "aB"), ("Aa" > "aB"), ("A" < "b"));
send_to_char(AT_BLUE,fst,ch);
return;
}


Notice that "test" is the argument required to set it off. My gues is that the whole segment above could be removed without harm.

Just my 2 cents,
KeB
0.0/7