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


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

Submitted by:  Steve Kappel <skappel>
Submitted on:  Fri 22 Mar 2013 03:42:50 PM UTC  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Postponed
Privacy: PublicAssigned to: None
Open/Closed: OpenComponent Version: simulavr

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


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>
Project 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 File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 24 Mar 2013 08:51:20 AM UTCtomkStatusNone=>Postponed

    Back to the top

    Powered by Savane 3.1-cleanup