Author |
Message |
Topic: Problem in itoa while it's used in multiple unit |
chenzhuo
Replies: 1
Views: 9279
|
Forum: General CCS C Discussion Posted: Sat Feb 03, 2018 5:33 am Subject: Problem in itoa while it's used in multiple unit |
I get trouble in using itoa in multiple compile unit.
Here's my code:
#include "18F46K22.H"
#include "stdlib.h"
void main(){
char buf[] = " ... |
Topic: rom space of two const arrays overlap |
chenzhuo
Replies: 11
Views: 13480
|
Forum: General CCS C Discussion Posted: Mon Jan 19, 2015 8:46 pm Subject: rom space of two const arrays overlap |
From software engineering perspective, i'd like to separate my code into several different module, hence the source code conflict could be avoided when collaborate with my partner and also code is of ... |
Topic: rom space of two const arrays overlap |
chenzhuo
Replies: 11
Views: 13480
|
Forum: General CCS C Discussion Posted: Mon Jan 19, 2015 10:45 am Subject: rom space of two const arrays overlap |
Interesting discovery:
If I compiled in a single compilation unit, the result is just what I expected:
a = 1, b=11
a = 2, b=12
a = 3, b=13
a = 4, b=14
a = 5, b=15
a = 6, b=16
However, ... |
Topic: rom space of two const arrays overlap |
chenzhuo
Replies: 11
Views: 13480
|
Forum: General CCS C Discussion Posted: Mon Jan 19, 2015 7:27 am Subject: rom space of two const arrays overlap |
Hi there,
I found a easy way to reproduce the issue:
const BYTE a[] = {1,2,3,4,5,6};
const BYTE b[] = {11, 12,13,14,15,16};
void main(){
s ... |
Topic: rom space of two const arrays overlap |
chenzhuo
Replies: 11
Views: 13480
|
Forum: General CCS C Discussion Posted: Mon Jan 19, 2015 7:09 am Subject: rom space of two const arrays overlap |
No, i know the pointer to const issue/limitation.
My usage is almost the same as below code, no pointer is involved.
const BYTE b[] = {1,2,3,4};
void foo()
{
... |
Topic: rom space of two const arrays overlap |
chenzhuo
Replies: 11
Views: 13480
|
Forum: General CCS C Discussion Posted: Sun Jan 18, 2015 10:33 am Subject: rom space of two const arrays overlap |
Two const arrays locate in separated rom spaces, which is expected, if #device const=rom is not defined in header.
Hence I think the abnormal behavior is caused by this directive.
Anyway, the purp ... |
Topic: rom space of two const arrays overlap |
chenzhuo
Replies: 11
Views: 13480
|
Forum: General CCS C Discussion Posted: Sun Jan 18, 2015 9:50 am Subject: rom space of two const arrays overlap |
Thanks for replying, Ttelmah
The multiple compilation units work fine in my project except this rom space overlap issue. I checked the mcu.zip you mentioned but I didn't find anything about how to ... |
Topic: rom space of two const arrays overlap |
chenzhuo
Replies: 11
Views: 13480
|
Forum: General CCS C Discussion Posted: Sat Jan 17, 2015 5:40 am Subject: rom space of two const arrays overlap |
compiler: 5.025
Hardware: PIC18F46K22
IDE: MPLAB X
It is probably a compiler issue, but i'm not sure. Hence i post it and see who else encounter the same issue.
The symptom is when multiple co ... |
|