d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Help. > Confused And Scared.
Prev123
Add Reply New Topic New Poll
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Nov 4 2014 01:59pm
Quote (killg0re @ Nov 4 2014 02:38pm)
If the syntax is incorrect, even if it compiles, it is still an error or else the compiler wouldn't have to warn you of the syntax being incorrect.


If it was incorrect syntax it wouldn't compile. Warnings don't warn for bad syntax. Warnings warn for possible logic errors. They are two separate things.
Member
Posts: 62,215
Joined: Jun 3 2007
Gold: 9,039.20
Nov 4 2014 02:01pm
The syntax was incorrect, but it didn't break, it only warned that it was incorrect.

There was definitely a logical error, for one she tried to use assignment where it doesn't belong, but that is also a problem of syntax.

You're taking things too literally here, the syntax is incorrect, or there wouldn't be a warning to use the correct operator.

Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Nov 4 2014 02:04pm
Quote (killg0re @ Nov 4 2014 03:01pm)
The syntax was incorrect, but it didn't break, it only warned that it was incorrect.

There was definitely a logical error, for one she tried to use assignment where it doesn't belong, but that is also a problem of syntax.

You're taking things too literally here, the syntax is incorrect, or there wouldn't be a warning to use the correct operator.


Your arguing Apple's and oranges. You just don't understand what a compiler warning is. You don't understand how a compiler operates and you don't understand the difference between syntax errors and logic errors.

Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Nov 4 2014 02:43pm
Quote (killg0re @ Nov 4 2014 04:01pm)
The syntax was incorrect, but it didn't break, it only warned that it was incorrect.

There was definitely a logical error, for one she tried to use assignment where it doesn't belong, but that is also a problem of syntax.

You're taking things too literally here, the syntax is incorrect, or there wouldn't be a warning to use the correct operator.


Should just give up here.

Its syntactically correct, you can make assignments inside if statements all you want. The logic however is incorrect. Thus why it would throw a warning. Syntax != warnings.

Example:

Code
if(justStop = right now()) {
Printf("just stop right now \n");
}


Another example:

Code
if((justStop = right now()) && strstr(just stop, "right meow")) {
Printf("just stop right now \n");
}


I use assignments in if statements all the time if I know I need to use it in the logic inside the if statement.

A more practical example:


Code
if((justStop = right now()) != NULL) {
Printf("just stop %s\n", justStop);
}


This post was edited by AbDuCt on Nov 4 2014 02:51pm
Member
Posts: 62,215
Joined: Jun 3 2007
Gold: 9,039.20
Nov 4 2014 03:03pm
Quote (AbDuCt @ Nov 4 2014 02:43pm)
Should just give up here.

Its syntactically correct, you can make assignments inside if statements all you want. The logic however is incorrect. Thus why it would throw a warning. Syntax != warnings.

Example:

Code
if(justStop = right now()) {
Printf("just stop right now \n");
}


Another example:

Code
if((justStop = right now()) && strstr(just stop, "right meow")) {
Printf("just stop right now \n");
}


I use assignments in if statements all the time if I know I need to use it in the logic inside the if statement.

A more practical example:


Code
if((justStop = right now()) != NULL) {
Printf("just stop %s\n", justStop);
}


Pwned, okay you win
Go Back To Programming & Development Topic List
Prev123
Add Reply New Topic New Poll