This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Gcc


const char *Tst = ""  = pointer to constant of type 'char'

const char * const Tst = "" = constant pointer to constant of type 'char'

Regards

  Dan Haynes

> -----Original Message-----
> From: Holger Burkarth [mailto:burkarth@prodad.de]
> Sent: Sunday, November 29, 1998 4:05 AM
> To: gnu-win32@cygnus.com
> Subject: Gcc
> 
> 
> Hi,
> 
> i have a little question, the normaly so good
> gcc machine-code, is in any case not
> so good, what is the reason ?
> 
> 
> 
> 
> ------ Source -------
> void test2()
> {
>   const char* Tst="";
> 
>   if(Tst != NULL) printf(Tst);
> }
> 
> 
> 
> $ gcc main.cpp -O2 -S
> 
> 
> 
> ------ Output -------
> .file"main.cc"
>  # GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release)
>  #  (i686-pc-cygwin32) compiled by GNU C version egcs-2.91.57 19980901
>  #  (egcs-1.1 release).
>  # options passed:  -mcpu=i486 -mno-stack-arg-probe -O2 
> -Wchar-subscripts
>  # -Wcomment -Wimplicit -Wparentheses -Wreturn-type -Wunused
>  # -Wuninitialized -Wshadow -Wwrite-strings 
> -Waggregate-return -Winline
>  # -fno-exceptions -fomit-frame-pointer -fverbose-asm
>  # options enabled:  -fdefer-pop -fomit-frame-pointer 
> -fcse-follow-jumps
>  # -fcse-skip-blocks -fexpensive-optimizations -fthread-jumps
>  # -fstrength-reduce -fpeephole -fforce-mem -ffunction-cse -finline
>  # -fkeep-static-consts -fcaller-saves -freg-struct-return -fgcse
>  # -frerun-cse-after-loop -frerun-loop-opt -fschedule-insns2
>  # -fsjlj-exceptions -fcommon -fverbose-asm -fgnu-linker -fregmove
>  # -foptimize-register-move -fargument-alias -m80387 -mhard-float
>  # -mno-soft-float -mieee-fp -mfp-ret-in-387 
> -mschedule-prologue -mcpu=i686
>  # -march=pentium
> 
> gcc2_compiled.:
> ___gnu_compiled_cplusplus:
> .text
> LC0:
> .ascii "\0"
> .globl _Test2__Fv
> 
> _Test2__Fv:
>  movl $LC0,%eax
>  testl %eax,%eax
>  je L138             <- why this ?
>  pushl %eax
>  call _printf
>  addl $4,%esp
> L138:
>  ret
> 
> 
> --
> Holger Burkarth
> Software-Developer
> burkarth@prodad.de
> http://www.prodad.de
> 
> -
> For help on using this list (especially unsubscribing), send 
> a message to
> "gnu-win32-request@cygnus.com" with one line of text: "help".
> 
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]