function call



Hi,

I am a little confused by the following example:

portCHAR myaddress = 0xFF;
ReadRegister(myaddress);
void ReadRegister(portSHORT address);

The compiler isn't giving me a warning for using a portCHAR(8 bit) as a
parameter when portSHORT(16 bit) is used.
But even though I expected the compiler to do "something" and assign
0x00FF to address, this was not the case.
Inside the function ReadRegister "address" is 0x??FF with ?? being
something undeterministic.
It is not "auto-casting" to 0x00FF.
I am fine with this functionality ... but I don't get it why there is
no compiler warning.
Any ideas?

thanks in advance

Juergen

I am using
cpu: MSP430xF1611
gcc: msp430-gcc 3.3.6
gdb: msp430-gdb 5.1.1
OS: linux
embedded OS: freeRTOS

.



Relevant Pages

  • Re: best way to suppress "unused" warning?
    ... each routine provides a void * pointer to carry user-defined ... Sometimes, however, the user-defined pointer is not needed which ... causes the compiler to spit out a "helpful" warning. ...
    (comp.lang.c)
  • Re: something to do with void *
    ... Either a warning ... it's allowed to produce any additional diagnostics it likes. ... If a compiler in conforming mode doesn't produce a diagnostic for the ... to have a void expression in some contexts, ...
    (comp.lang.c)
  • Re: Why INFINITE loop in a thread occupy so much CPU time??
    ... With the attendant warning about the constant expression. ... This is a common programming technique. ... Good programming practice would consist of using the compiler at ... One can write 'bool' in C++ but not C. ...
    (microsoft.public.vc.mfc)
  • Re: best way to suppress "unused" warning?
    ... each routine provides a void * pointer to carry user-defined ... Sometimes, however, the user-defined pointer is not needed which ... causes the compiler to spit out a "helpful" warning. ...
    (comp.lang.c)
  • Re: help needed please!
    ... But some compilers like to give you a warning ... Each warning a compiler can give you is important when you not ... but you may use flages to handle flags to handle flags when you ... >> stdout is line bufferd and until one or both of the following cases is ...
    (comp.lang.c)