Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type mismatch? #1

Open
tilator opened this issue Mar 4, 2018 · 6 comments
Open

Type mismatch? #1

tilator opened this issue Mar 4, 2018 · 6 comments

Comments

@tilator
Copy link

tilator commented Mar 4, 2018

Hello,

Compiling in Linux (64-bit) gives this error:

sdcc: Generating code...
relay.c:54: error 47: indirections to different types assignment
from type 'const-char [3] code'
to type 'char fixed'

What should be changed?

@libretto
Copy link
Owner

libretto commented Mar 4, 2018

Which version of sdcc do You use? Could You give me output of sdcc -v?

@libretto
Copy link
Owner

libretto commented Mar 4, 2018

I compiled this code under sdcc version 3.5 In elder version of sdcc had a problem with such type of string initializer constants.
If You replace string #54 with
char a[] = { 'U','P' };
It must works in Your compiler too...

libretto added a commit that referenced this issue Mar 4, 2018
Fixup issue #1 which is related to older sdcc version (ver <3.5.0)
@libretto
Copy link
Owner

libretto commented Mar 4, 2018

just added this fixup to master branch

@tilator
Copy link
Author

tilator commented Mar 7, 2018

Hi,

I did try to compile it with two different Linuxes. Both did give same error.

One sdcc version is:

SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.3.0 #8604 (Dec 30 2013) (Linux)

I try it again now.

@tilator
Copy link
Author

tilator commented Mar 7, 2018

It seems to compile now having only one warning:

relay.c:173: warning 158: overflow in implicit constant conversion

The compiled hex seems to work too.

Thanks.

@libretto
Copy link
Owner

libretto commented Mar 7, 2018

Yes, I know about this warning. It because TL0 is byte but BAUD is a word. On value assignment, high byte is ignored by default. So the behaviour of code is right. But maybe I will fix up this warning later by adding some byte operation in this line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants