bugSimulavr: an AVR simulator - Bugs: bug #38572, Problem with variable...

 
 

bug #38572: Problem with variable "SS" in hwspi

Submitter:  Steve Kappel <skappel>
Submitted:  Fri 22 Mar 2013 03:42:50 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Component Version:  * simulavr
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 27 Mar 2013 10:16:02 PM UTC, comment #4: 

This is caused by a GCC/Solaris problem.  GCC, on Solaris, defines _EXTENSIONS_ which eventually pulls in the include file with the poorly-named symbols.  Of course Solaris shouldn't define such symbols in the first place.  And GCC shouldn't define _EXTENSIONS_.

It would be a long and likely fruitless endeavor to try to get either/both of those changed.

I understand this is unlikely to be worked around in simulavr.  While more descriptive variable names would be beneficial I'm sure there is little desire to fix this for a non-Linux/Windows O/S.

Steve Kappel <skappel>
Mon 25 Mar 2013 08:07:11 PM UTC, comment #3: 

Ignore my last post for obvious reasons.

I finally found it.  It is defined in the O/S include file <sys/regset.h> as a define of "SS" to "18".  Comments indicate this is the stack segment register in i386.  Obviously this will never be changed on an O/S.

Suggest all AVR symbols should be prefixed with AVR_

Steve Kappel <skappel>
Sun 24 Mar 2013 04:18:58 PM UTC, comment #2: 

Please close.  It is not a simulavr problem.  Nor an Ada problem.

% cat z.cpp
int main()
{
#warning SS
}
% g++ -c z.cpp
z.cpp:3:2: warning: #warning SS [-Wcpp]

So far I haven't been able to find "SS" in the gcc sources...

Steve Kappel <skappel>
Sun 24 Mar 2013 08:50:12 AM UTC, comment #1: 

Hi Steve,

I think, this problem is not because the name in HWSpi class. So, renaming the name of this class member isn't really a fix.

The question is, who defines this name before? Maybe as a define in commandline or in some environment settings?

And you use a GCC with Ada enabled. Maybe this is the source of your problem. (I'm not sure) Try to use a normal plain gcc.

cu, Thomas

Thomas K. <tomk>
Group administrator
Fri 22 Mar 2013 03:42:50 PM UTC, original submission:  

In src/hwspi.h and src/hwspi.cpp the variable named SS causes an error due to SS being already defined as "SS [-Wcpp]":

    gmake[3]: Entering directory `/export/scratch/builds/ada/native/simulavr-1.0.0-obj/src'
    /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../simulavr-1.0.0/src    -I/scratch/builds/ada/run/include -g -O2 -Icmd -Iui -Ihwtimer -MT at4433.lo -MD -MP -MF .deps/at4433.Tpo -c -o at4433.lo ../../simulavr-1.0.0/src/at4433.cpp
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../simulavr-1.0.0/src -I/scratch/builds/ada/run/include -g -O2 -Icmd -Iui -Ihwtimer -MT at4433.lo -MD -MP -MF .deps/at4433.Tpo -c ../../simulavr-1.0.0/src/at4433.cpp  -fPIC -DPIC -o .libs/at4433.o
    In file included from ../../simulavr-1.0.0/src/at4433.h:35:0,
                     from ../../simulavr-1.0.0/src/at4433.cpp:26:
    ../../simulavr-1.0.0/src/hwspi.h:57:19: error: expected unqualified-id before numeric constant
    gmake[3]: * [at4433.lo] Error 1

When I insert the statement "#warning Symbol SS" right before line 57 of hwspi.h I get:

    In file included from ../../simulavr-1.0.0/src/at4433.h:35:0,
                     from ../../simulavr-1.0.0/src/at4433.cpp:26:
    ../../simulavr-1.0.0/src/hwspi.h:57:2: warning: #warning Symbol SS [-Wcpp]
    ../../simulavr-1.0.0/src/hwspi.h:58:19: error: expected unqualified-id before numeric constant

This is using gcc 4.7.2 with Ada enabled.

Renaming the variable eliminates the problem.

Steve Kappel <skappel>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tomk (Posted a comment)
  • -email is unavailable- added by skappel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-10-04 tomk StatusPostponed Wont Fix
        Open/ClosedOpen Closed
    2013-03-24 tomk StatusNone Postponed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code