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.
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.