View Single Post
  #3   Spotlight this post!  
Unread 09-02-2007, 20:28
gnirts gnirts is offline
Suspicious pointer conversion
AKA: Robinson Levin
FRC #1648 (The Gearbox Gangstaz)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: ATL
Posts: 116
gnirts will become famous soon enough
Re: Am i just not seeing it?

Check the file the was compiled just before it, or more likely the last file #include'd in the the file where the error appears. Look for missing }s. The compiler is weird that way, although possibly technically right, as the faulty syntax isn't until something unexpected happens, like when you try and start one function definition inside another one.

Another way to isolate invisible errors inside a file is to put known-good code before and after the line with the error, eg.
Code:
int someFunction(void) {
    int i;
    int j;

    i = j /4; //this line is for some reason producing an error
    return i;
}
So do this:
Code:
int someFunction(void) {
    int i;
    int j;
    
    printf("hello");
    i = j /4; //this line is for some reason producing an error
    printf("everyone");
    return i;
}
And see if the compiler still says its on the same line, or if it is now stopping on the upper or lower printf(). If so, then you know your error is on either side of the statement you were looking at, so check for the usual missing ; or }.

Good luck,
Robinson