On Mon, Dec 04, 2017 at 08:56:05AM +0800, chengjian (D) wrote:
> So my question is :
> It seems that one of the optimization options in the -O1 option eliminates
> the dead code, I have seen the optimize doccument about GCC
>
> https://gcc.gnu.org/onlinedocs/gcc-6.4.0/gcc/Optimize-Options.html
>
On 2017/12/4 10:25, carl hansen wrote:
line 12 , you say "void A( );"
say instead:
void A(){};
That solved it for me, using gcc7.2
Yeah, I miss the implementation, but I did this on purpose
I'm curious is there any options to eliminate this.
like gcc -O2 do.
thanks.
line 12 , you say "void A( );"
say instead:
void A(){};
That solved it for me, using gcc7.2
On Sun, Dec 3, 2017 at 4:56 PM, chengjian (D) wrote:
> I have written a simple code like this
>
> ```c
> #include
> #include
>
> //#define CONFIG_TARGET_X86_64
>
> #ifdef CONFIG_TARGET_X86_64
> static
I have written a simple code like this
```c
#include
#include
//#define CONFIG_TARGET_X86_64
#ifdef CONFIG_TARGET_X86_64
static void A( )
{
printf("A\n");
}
#else
void A( );
#endif
static void B( )
{
printf("B\n");
}
static int xx( )
{
#ifdef CONFIG_TARGET_X86_64
return 1;
#else