Farhat
Farhat

Reputation: 85

Linux terminal - error: label at end of compound statement

I'm using x64 Ubuntu Linux via VMware Player as a virtual machine. As a part of my project, I need to install some library (fec-3.0.1). I'm new to Linux and not good at coding.

Here is the error I encounter in terminal after successful configuration:

    farhat@ubuntu:~/project/fatcaps_v0.5/fec-3.0.1$ make
    gcc -g -O2 -I. -Wall    -c -o dotprod.o dotprod.c
    dotprod.c: In function ‘freedp’:
    dotprod.c:56:3: error: label at end of compound statement
       default:
       ^
    make: *** [dotprod.o] Error 1

Here is function 'freedp' content (the start line is 55):

    /* Free a dot product descriptor created earlier */
    void freedp(void *p){
      switch(Cpu_mode){
      case PORT:
      default:
    #ifdef __i386__
      case MMX:
      case SSE:
        return freedp_mmx(p);
      case SSE2:
        return freedp_sse2(p);
    #endif
    #ifdef __VEC__
      case ALTIVEC:
        return freedp_av(p);
    #endif
      }
    }

What should I do?

Upvotes: 7

Views: 25147

Answers (1)

zhb
zhb

Reputation: 687

The reason why you meet the error label at end of compound statement is because the default case can not be empty, it means you must provide a break or ; empty statement.

Edited: I find some material on that topic, and I got that: https://mail.gnome.org/archives/evolution-patches/2004-April/msg00235.html, It is the problem about the compiler gcc3.4, which reports an error on default without statements, and it is warning on gcc3.3, but now, I test on gcc4.8.2, it is all right....

Upvotes: 17

Related Questions