This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430F6636: CCS build error with missing Semicolon

Part Number: MSP430F6636


Tool/software: Code Composer Studio

Hi,

I don't know why but my CCS ver 7.0.0.00042 don't detect missing semicolon in my header file. When i try compile the code i get 100 errors in 5 different files except missing semicolon line! 

Can you please fix it in the next update!

BS

KRis

  • This is harder than you think.

    Harbison and steele:
    "In C source programs the blank (space), end-of-line, vertical tab, form feed, and horizontal tab (if present) are known collectively as whitespace characters...These characters are ignored except insofar as they are used to separate tokens"

    Only preprocessor lines use the linefeed as a termination character. This is legal C:
    volatile
    int
    a,
    b,
    c
    ;
  • What is the semicolon used for? Do you actually mean source file?

    Stephen
  • Thx guys for answered the problem is with xxx.h files. For example  download empty project for USB  for F5529 to our CCS then go to  USB_API\USB_MSC_API\  folder then open USBMSC.h file and remove semicolon from uint8_t USBMSC_pollCommand(void)   line then compile the code and you will get bunch of errors. 

  • If you mean me, the semicolon terminates the statement that would usually be written:
    volatile int a,b,c;

    I was just being pathological. But compiler writers have to consider pathological cases.

    I think it is impossible to have a c file without a semicolon. 8^)

    They can easily show up in header files (.h) or program files (.c). I am not sure what you mean by "source". I was quoting Harbison and Steele - so it has to be correct. 8^)
  • You have stumbled on a tricky one. If the compiler still accepts old-style C function definitions, it can go really far down a rabbit hole.
  • I agree with you like you know a header file is a file containing C declarations and macro definitions files don't have any source code so compiler should know if is header the missing semicolon mean error. Then go to the line just like Visual Studio do i need see extra 100 errors?

    I know you can say you always need semicolon but you can move some code paste and will missing 8^)
  • I feel your pain, but generating good error messages is very difficult. I know, because I wrote a parser and used a C expression grammar. Even with this small subset of a language I found it difficult to produce meaningful errors in some cases.

    Note that the compilers with the better messages like Visual Studio and Clang have the most resources. I understand that gcc is rather poor in this regard, also. Usually the trick is to just focus on the first error, fix that and re-try.
  • Keith Barkley said:
    I think it is impossible to have a c file without a semicolon. 8^)

    For amusement value, consider "int main() { }", which is strictly conforming.

  • I knew that, hence the smiley.
    A .h file with only #defines would not have semicolons, either.
  • Ah, but don't you see, I knew you knew that!