Compilator warning
Moderator: BigEvilCorporation
Compilator warning
For all gcc guru, I just lost some times on a...'problem'
I renamed a function and create another one with the same name as the previous.
The renamed is in the .H file, the new one with the older name is not.
When I compile, I have no error nor warnings while another C file still call the older name function
how the .C file could call a private function (not in the .H file)
how GCC won't cry while the number of arguments is different (2 vs 0)
I think it's a param for gcc compiler to be more strict but, well...you see...I don't know gcc params
I'm at 100% for strict warnings so how can I active strong checking ?
ho, yes, before you ask, it's still my good ol'one XGCC compiler
ps: I post it in Megadrive/Genesis subtopic because it could be a XGCC failure...
I renamed a function and create another one with the same name as the previous.
The renamed is in the .H file, the new one with the older name is not.
When I compile, I have no error nor warnings while another C file still call the older name function
how the .C file could call a private function (not in the .H file)
how GCC won't cry while the number of arguments is different (2 vs 0)
I think it's a param for gcc compiler to be more strict but, well...you see...I don't know gcc params
I'm at 100% for strict warnings so how can I active strong checking ?
ho, yes, before you ask, it's still my good ol'one XGCC compiler
ps: I post it in Megadrive/Genesis subtopic because it could be a XGCC failure...
Last edited by KanedaFr on Fri Oct 26, 2007 11:31 am, edited 2 times in total.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Seems a lot of guys has trouble with the .LD file, specially on linux system. What sort of bug you meet ? i need to fix that for the next versionKanedaFr wrote:...it's -Wall ...
I switched to StefDevKit's GCC.
After a fight with asm file and a bug in the .ld file, I finally produce my binary...which lose 20k (on 64k)!!
ok, I vote, XGCC is now history!!!
hop, jump to Eclipse configuration...next week
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
This is the one we worked out for me in linux.Stef wrote:Seems a lot of guys has trouble with the .LD file, specially on linux system. What sort of bug you meet ? i need to fix that for the next versionKanedaFr wrote:...it's -Wall ...
I switched to StefDevKit's GCC.
After a fight with asm file and a bug in the .ld file, I finally produce my binary...which lose 20k (on 64k)!!
ok, I vote, XGCC is now history!!!
hop, jump to Eclipse configuration...next week
Code: Select all
OUTPUT_ARCH(m68k)
SEARCH_DIR(.)
/*GROUP(-lbcc -lc -lgcc)*/
__DYNAMIC = 0;
/*
* Setup the memory map of the SEGA Genesis.
* stack grows down from high memory.
*
* The memory map look like this:
* +--------------------+ <- low memory
* | .text |
* | _etext |
* | ctor list | the ctor and dtor lists are for
* | dtor list | C++ support
* +--------------------+
* | .data | initialized data goes here
* | _edata |
* +--------------------+
* | .bss |
* | __bss_start | start of bss, cleared by crt0
* | _end | start of heap, used by sbrk()
* +--------------------+
* . .
* . .
* . .
* | __stack | top of stack
* +--------------------+
*/
MEMORY
{
rom : ORIGIN = 0x00000000, LENGTH = 0x00400000
ram : ORIGIN = 0x00ff0000, LENGTH = 0x00010000
}
/*
* allocate the stack to be at the top of memory, since the stack
* grows down
*/
PROVIDE (__stack = 0x00fffff0);
/*
* Initalize some symbols to be zero so we can reference them in the
* crt0 without core dumping. These functions are all optional, but
* we do this so we can have our crt0 always use them if they exist.
* This is so BSPs work better when using the crt0 installed with gcc.
* We have to initalize them twice, so we cover a.out (which prepends
* an underscore) and coff object file formats.
*/
PROVIDE (hardware_init_hook = 0);
PROVIDE (_hardware_init_hook = 0);
PROVIDE (software_init_hook = 0);
PROVIDE (_software_init_hook = 0);
SECTIONS
{
.text 0x00000000:
{
*(.text)
. = ALIGN(0x4);
__CTOR_LIST__ = .;
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
*(.ctors)
LONG(0)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
*(.dtors)
LONG(0)
__DTOR_END__ = .;
*(.rodata*)
*(.gcc_except_table)
__INIT_SECTION__ = . ;
*(.init)
SHORT (0x4e75) /* rts */
__FINI_SECTION__ = . ;
*(.fini)
SHORT (0x4e75) /* rts */
_etext = .;
*(.lit)
} > rom
.data 0xff0000 :
{
*(.shdata)
*(.data)
_edata = .;
} > ram
.bss 0xff0000 :
{
__bss_start = . ;
*(.shbss)
*(.bss)
*(COMMON)
*(.eh_fram)
*(.eh_frame)
_end = ALIGN (0x8);
__end = _end;
} > ram
.stab 0 (NOLOAD) :
{
*(.stab)
}
.stabstr 0 (NOLOAD) :
{
*(.stabstr)
}
}
http://www.uclinux.org/pub/uClinux/m68k ... 14.tar.bz2
Just remember to use the 68000 version of the libgcc.a file. The default one used by uclinux is for higher 68ks. They have a directory in the arc that has the 68000 version. Once you have the md.ld above and the proper libgcc.a, it works great. I'm using it in CodeBlocks in Fedora 7.
Now I need to make a compiler setting and ld file for Sega CD...
-
- Very interested
- Posts: 159
- Joined: Sat Feb 24, 2007 11:35 pm
- Location: San Antonio, TX
As long as we're all showing off our linker scripts, here's the one I ended up with after getting someone's OS X-based GCC 3.4.4 working. It was a total pain to get initialized global data working. It's not great, but it may have something in it that someone will find useful:
I still couldn't get a glibc working and had to find my own memcpy. I tried to get a gcc 4.x working first, but it was just too complicated to get an m68k GCC built. Building your own cross-gcc is not trivial.
Anyhow, after getting a hello-world working, I haven't had any time to do my own coding, because of my real job. But at least the real job puts money in the bank.
Code: Select all
SECTIONS
{
.text 0x00000000:
{
. = ALIGN(2);
*(.text)
. = ALIGN(2);
*(.rodata)
. = ALIGN(2);
*(.rodata.*)
_etext = .;
} = 0xFF
.data 0xFFFF0000:
AT (_etext)
{
_data = .;
. = ALIGN (2);
*(.data)
_edata = .;
} = 0xFF
.bss :
{
. = ALIGN(2);
*(.bss)
. = ALIGN(2);
*(COMMON)
}
}
Anyhow, after getting a hello-world working, I haven't had any time to do my own coding, because of my real job. But at least the real job puts money in the bank.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
You can set per project compiler choice, linker options, etc. If you follow the guides here, you setup a special compiler setting specifically aimed at the Genesis, then choose it in the project prefs. My aim for SEGA CD is to set up another that handles the Genesis while the CD is active, and yet another for the CD part. I guess that's the three you are talking about.Fonzie wrote:Does code blocks allow you to have a different .ld per project?
Because, for a simple megacd game, you have minimum of 3 .ld , and each game is different ^^.