Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Very Easy FTEQCC Compile Question

| Inside3d Forums Forum Index -> QuakeC Programming

View previous topic :: View next topic
Author | Message
--- | ---
Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Mon Oct 13, 2008 8:27 am Post subject: Very Easy FTEQCC Compile Question |

Why doesn't FTEQCC like this?

Quote:
bprint(")");

I get "error: expected ;, found )"
Not a "problem", I just add a space and make it bprint(") "); and the issue goes away, but I'd just like to know why the compiler doesn't like the original above.

Back to top |

Wazat Joined: 15 Oct 2004 Posts: 732 Location: Middle 'o the desert, USA |

Posted: Mon Oct 13, 2008 8:54 am Post subject: |

Weird! Maybe try:

Code:
bprint("\)"); or bprint(")\ ");

... and see what that does.
Must be a mistake in the compiler. I would almost expect it to actually be an error in another line (like a " that isn't paired), but since adding a space after the ) fixes it then I doubt that's the case.
Maybe check the fteqcc readme. A ) may be a special character in double-quote strings that's being interpreted to have a special meaning or reference rather than taken literally. Maybe it's expecting a parameter (like a printf with a %i in it) or something after the "" string ends, or the ) is acting like a \ on the ending ", so the string isn't getting terminated or is otherwise weirding out.
_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.

Back to top |

Spike Joined: 05 Nov 2004 Posts: 944 Location: UK |

Posted: Mon Oct 13, 2008 9:02 am Post subject: |

Strange... ) isn't a special character at all for strings (other than that it'll terminate a #MACRO name inside a string). I'll need to look into this some time... Everything else compiles and runs fine, I assume, just with the extra space? _________________
What's a signature?

Back to top |

Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Mon Oct 13, 2008 9:11 am Post subject: |

Spike wrote:
Strange... ) isn't a special character at all for strings (other than that it'll terminate a #MACRO name inside a string). I'll need to look into this some time... Everything else compiles and runs fine, I assume, just with the extra space?

Yeah, everything else compiles fine and it runs fine if I add the extra space.
I may not be using the current build of FTEQCC, I will download current version, test again and see what happens sometime later today.
I am playing around with Paraboil Frogbot stuff and it has numerous #IFDEFs in it, btw, so it could have something to do with that.

Back to top |

FrikaC Site Admin Joined: 08 Oct 2004 Posts: 947 |

Posted: Mon Oct 13, 2008 5:11 pm Post subject: |

I solved this bug before in FrikQCC, it's a QCC bug iirc, and the cause is that ")" passes the PR_Check for the end of the function call regardless of the fact it is flagged as a string token type and not a punctuation token type. There's a bunch of ways to solve it. I forgot which one I chose.

Back to top |

Spike Joined: 05 Nov 2004 Posts: 944 Location: UK |

Posted: Mon Oct 13, 2008 10:24 pm Post subject: |

Yup FrikaC is quite correct with that solution. Thanks, you just made my life that little bit easier. In the mean time, just make a global string closebracket=")"; :D I'd commit it but I'm lazy, and have a few other tweeks in there which will cause all sorts of similar obscure errors.
_________________
What's a signature?

Back to top |

Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Wed Oct 15, 2008 3:26 am Post subject: |

Spike wrote:
Yup FrikaC is quite correct with that solution. Thanks, you just made my life that little bit easier. In the mean time, just make a global string closebracket=")"; I'd commit it but I'm lazy, and have a few other tweeks in there which will cause all sorts of similar obscure errors.

I wasn't using the current version of fteqcc and this problem doesn't occur in the current version of fteqcc.
So I guess that's that.

Back to top |

Spike Joined: 05 Nov 2004 Posts: 944 Location: UK |

Posted: Wed Oct 15, 2008 10:42 am Post subject: |

Hrm? that problem should appear in the current svn version. And if it doesn't then I don't know why it works. :) I'll commit a fix once I properly get around to testing variable initialisers on locals... and support for #if defined(a) || defined(b)... and figure out what LH wants to do with a possible -TDP option.
_________________
What's a signature?

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> QuakeC Programming | All times are GMT
Page 1 of 1

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group