warning: always_inline function might not be inlinable

I’m using SoftwareSerial in a couple of sketches and the first time I do ‘compile’ I get the following warnings

C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial\SoftwareSerial.cpp:375:6: warning: always_inline function might not be inlinable [-Wattributes]
void SoftwareSerial::setRxIntMsk(bool enable)
^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial\SoftwareSerial.cpp:121:6: warning: always_inline function might not be inlinable [-Wattributes]
void SoftwareSerial::recv()
^
Everything seems to be working OK so do I need to worry
Thanks
Dave

‘always_inline’ attribute says to the compiler to inline the function even when the compiler optimization parametters are off. Most of the inline functions in the libraries are set to ‘always_inline’.

The message you got will not show up (AFAIK) if the compiler optimization are on.

from the above, you can deduce that for some reasons, not all your compiler optimization settings are on.

Besides this, the message will do any harm.

Perhaps you turned up the warnings in Preferences? The options are None, Default, More, and All. I would expect "Default" to be the default. :slight_smile:

No, I'm still at default.

I don’t know if this is related to the problem, but I recently noticed that the “inline” interrupt handler in SoftwareSerial was actually inline when compiled in IDE 1.0.6 but called as a subroutine when compiled in IDE 1.6.4. This test was done with identical SoftwareSerial.cpp and .h code.

1.0.6:

#if defined(PCINT0_vect)
ISR(PCINT0_vect)
    1034:	1f 92       	push	r1
    1036:	0f 92       	push	r0
    1038:	0f b6       	in	r0, 0x3f	; 63
    103a:	0f 92       	push	r0
    103c:	11 24       	eor	r1, r1
    103e:	2f 93       	push	r18
    1040:	3f 93       	push	r19
    1042:	4f 93       	push	r20
    1044:	5f 93       	push	r21
    1046:	6f 93       	push	r22
    1048:	7f 93       	push	r23
    104a:	8f 93       	push	r24
    104c:	9f 93       	push	r25
    104e:	af 93       	push	r26
    1050:	bf 93       	push	r27
    1052:	ef 93       	push	r30
    1054:	ff 93       	push	r31
//

/* static */
inline void SoftwareSerial::handle_interrupt()
{
  if (active_object)
    1056:	80 91 69 01 	lds	r24, 0x0169
    105a:	90 91 6a 01 	lds	r25, 0x016A
    105e:	00 97       	sbiw	r24, 0x00	; 0
    1060:	11 f0       	breq	.+4      	; 0x1066 <__vector_3+0x32>
  {
    active_object->recv();
    1062:	0e 94 b0 07 	call	0xf60	; 0xf60 <_ZN14SoftwareSerial4recvEv>

#if defined(PCINT0_vect)
ISR(PCINT0_vect)
{
  SoftwareSerial::handle_interrupt();
}
    1066:	ff 91       	pop	r31
    1068:	ef 91       	pop	r30
    106a:	bf 91       	pop	r27
    106c:	af 91       	pop	r26
    106e:	9f 91       	pop	r25
    1070:	8f 91       	pop	r24
    1072:	7f 91       	pop	r23
    1074:	6f 91       	pop	r22
    1076:	5f 91       	pop	r21
    1078:	4f 91       	pop	r20
    107a:	3f 91       	pop	r19
    107c:	2f 91       	pop	r18
    107e:	0f 90       	pop	r0
    1080:	0f be       	out	0x3f, r0	; 63
    1082:	0f 90       	pop	r0
    1084:	1f 90       	pop	r1
    1086:	18 95       	reti

00001088 <__vector_4>:
#endif

1.6.4:

/* static */
inline void SoftwareSerial::handle_interrupt()
{
  if (active_object)
    1078:	80 91 9e 01 	lds	r24, 0x019E
    107c:	90 91 9f 01 	lds	r25, 0x019F
    1080:	00 97       	sbiw	r24, 0x00	; 0
    1082:	09 f0       	breq	.+2      	; 0x1086 <_ZN14SoftwareSerial16handle_interruptEv+0xe>
  {
    active_object->recv();
    1084:	37 cf       	rjmp	.-402    	; 0xef4 <_ZN14SoftwareSerial4recvEv>
    1086:	08 95       	ret

00001088 <__vector_2>:
  }
}

#if defined(PCINT0_vect)
ISR(PCINT0_vect)
{
    1088:	1f 92       	push	r1
    108a:	0f 92       	push	r0
    108c:	0f b6       	in	r0, 0x3f	; 63
    108e:	0f 92       	push	r0
    1090:	11 24       	eor	r1, r1
    1092:	2f 93       	push	r18
    1094:	3f 93       	push	r19
    1096:	4f 93       	push	r20
    1098:	5f 93       	push	r21
    109a:	6f 93       	push	r22
    109c:	7f 93       	push	r23
    109e:	8f 93       	push	r24
    10a0:	9f 93       	push	r25
    10a2:	af 93       	push	r26
    10a4:	bf 93       	push	r27
    10a6:	ef 93       	push	r30
    10a8:	ff 93       	push	r31
  SoftwareSerial::handle_interrupt();
    10aa:	e6 df       	rcall	.-52     	; 0x1078 <_ZN14SoftwareSerial16handle_interruptEv>
}
    10ac:	ff 91       	pop	r31
    10ae:	ef 91       	pop	r30
    10b0:	bf 91       	pop	r27
    10b2:	af 91       	pop	r26
    10b4:	9f 91       	pop	r25
    10b6:	8f 91       	pop	r24
    10b8:	7f 91       	pop	r23
    10ba:	6f 91       	pop	r22
    10bc:	5f 91       	pop	r21
    10be:	4f 91       	pop	r20
    10c0:	3f 91       	pop	r19
    10c2:	2f 91       	pop	r18
    10c4:	0f 90       	pop	r0
    10c6:	0f be       	out	0x3f, r0	; 63
    10c8:	0f 90       	pop	r0
    10ca:	1f 90       	pop	r1
    10cc:	18 95       	reti

000010ce <__vector_3>:
#endif