Strange warning message

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I get this on error output when compiling with the latest gcc, version 4.2.2.

D:\WINDOWS\TEMP/ccA4jNXp.s: Assembler messages:
D:\WINDOWS\TEMP/ccA4jNXp.s:35: Warning: expression dangerous with linker stubs
D:\WINDOWS\TEMP/ccA4jNXp.s:36: Warning: expression dangerous with linker stubs

It happens when compiling for the mega169, mega329, and mega649. Another poster had this problem for the mega48.
https://www.avrfreaks.net/index.p...

I don't get the message with earlier versions of gcc like version 4.1.2. The warning also appears in the .lst file and in the WINDOWS/TEMP/ccA4jNXp.s (or whatever) file. The optimization is -Os.

The code seems to work despite the warning. It is C++ code. The warning only appears in a very special circumstance. I spent a lot of time simplifying the real code to produce something as simple as possible that still causes the warning.

I now have two classes, Test2 and Test4. They don't do anything useful except to produce the warning. The problem occurs in Test2 which has a big switch statement, but to make the warning occur I need to call a function in another class. A function that doesn't get inlined. That is the only purpose of class Test4.

Changing almost any line in Test2 eliminates the warning. Doing any one of the following will eliminate the warning.

Remove any switch case.
Change the case value of any case to a number greater than 51.
Remove any of the "secondsToDisable =" lines.
Remove the call to Test4::Function().
Change the Test4::Function() call to Test4::InlineFunction().

It seems I can only upload 3 attachments per post. If anyone wants to see the other 3 files, I can make another post.

Attachment(s): 

Last Edited: Mon. Feb 18, 2008 - 03:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Steve,

Can you confirm that it appears to be these lines it is complaining about:

	subi r30,lo8(-(gs(.L10)))
	sbci r31,hi8(-(gs(.L10)))

The only "odd" thing in that would appear to be the gs()

(to be honest I don't know what that is!)

EDIT: Oh, and before someone (u no who!) complains I'll move this to GCC...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, those are the lines. Lines 34 and 35 in that .s file.

Sorry about posting in the wrong forum. I have two excuses that come to mind. I'm old and feeble and I'm a newbie and have been since Sept 7, 2004. Will either one of those work?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I talked to Jörg about this error , and this warning is unneeded.
The reason it is not in 4.12 , is that there was made a fix to remove this "unnesesary" warning.
But the fix eitehr dissapeared or didn't work in the latest avr-gcc.

But as the warning was "patched" out by purpose in 4.12 , you can safely ignore it in the later version also.

/Bingo