C++ has never been officially supported by mspgcc, and this appears to
require a change to the compiler rather than simple header modification:
C++ apparently does something unexpected with attribute merges.

I've confirmed the behavior.  Please enter this as a bug at
https://sourceforge.net/p/mspgcc/bugs/.  If there is another mspgcc release
I'll may be able to fix it then.

Peter


On Mon, Sep 9, 2013 at 2:45 PM, Andrew Wygle <awy...@berkeley.edu> wrote:

> After further investigation, I discovered that this code is actually being
> compiled as C++. This explains the difference in our experience, but not
> the error itself. A minimally reproducible example:
>
> #include <msp430.h>
> #include <stdint.h>
>
> int main(int argc, char *argv[]) {
>     uint8_t addr = 0x02;
>     P4OUT |= addr;
>     return 0;
> }
>
> Compiled with:
>
> msp430-g++ -mmcu=msp430fr5969 -c error.cpp -Os
>
>
>
>
>
> On Fri, Sep 6, 2013 at 11:35 AM, Peter Bigot <big...@acm.org> wrote:
>
>> I'm unable to duplicate that with the following program using msp430-gcc
>> -Os -mmcu=msp430fr5969 -c x.c and similar variants.
>>
>> The attributes are documented at
>> https://sourceforge.net/apps/mediawiki/mspgcc/index.php?title=Gcc47:20-Bit_Designbut
>>  it should not be necessary for you to be aware of them for this sort of
>> code.
>>
>> Peter
>>
>> #include <msp430.h>
>> #include <stdint.h>
>>
>> extern uint8_t v;
>>
>> int doit ()
>> {
>>   P4OUT |= v;
>>   return 1;
>> }
>>
>>
>>
>> On Fri, Sep 6, 2013 at 12:14 PM, Andrew Wygle <awy...@berkeley.edu>wrote:
>>
>>> Hello all,
>>>
>>> I'm new to this list, I've been using mspgcc to develop for the new
>>> MSP430FR5969 (the 64k FRAM MSP), and I recently ran into an error when
>>> trying to assign to port 4 of that device.
>>>
>>> The line of code is:
>>> P4OUT |= var;
>>> where var is an 8-bit unsigned integer less than 8 in this particular
>>> case.
>>>
>>> The reported error is:
>>> error: merged types have inconsistent d16/d20 attributes.
>>>
>>> This would seem to indicate some kind of data type width error. This is
>>> born out by the fact that if I change var to be an unsigned 16-bit
>>> integer,
>>> the assignment works just fine. However, P4 should be an 8-bit (byte)
>>> wide
>>> port. I'd never seen the d16/d20 notation before, and I wasn't able to
>>> find
>>> any information on it through Google, so I'd like to hopefully understand
>>> what I'm doing wrong and why I'm seeing this error.
>>>
>>> Thanks for the assistance.
>>>
>>> ~Andrew Wygle
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
>>> Discover the easy way to master current and previous Microsoft
>>> technologies
>>> and advance your career. Get an incredible 1,500+ hours of step-by-step
>>> tutorial videos with LearnDevNow. Subscribe today and save!
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Mspgcc-users mailing list
>>> Mspgcc-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>>>
>>>
>>
>
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to