bugTiny C Compiler - Bugs: bug #15332, static var intialization

 
 

bug #15332: static var intialization

Submitted by:  None
Submitted on:  Fri 30 Dec 2005 10:42:28 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 30 Dec 2005 10:42:28 PM UTC, original submission:

Calling a tcc function with static from gcc doesn't set the static correctly.

hello.c:
#include <stdio.h>
void hello(void) {
static int x;
printf("x is at %p\n",&x);
}

hellomain.c:
int main(int argc, char *argv[]) {
void hello(void);
hello();
}

tcc -c hello.c; gcc hellomain.c hello.o

Initializing the static using "static int x=1" or compiling hellomain with tcc fixes the problem.

Debian tcc/unstable 0.9.23-2
gcc version 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)
Linux 2.6.12 #2 SMP Tue Aug 9 23:20:52 CEST 2005 i686 GNU/Linux

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by grischka (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 18 Oct 2012 04:58:37 PM UTCgrischkaStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1