Skip to contentSkip to conversation

ltp_signal.h: Remove inline keyword from handler_h.

PATCH In review Vinson Lee 3 participants 6 messages Aug 3, 2012 – Oct 4, 2012

lore
Share & tools
lore

Vinson Lee

author
#0 lore raw

PATCH 1/1 ltp_signal.h: Remove inline keyword from handler_h.

This patch fixes this build error with clang.

testcases/kernel/syscalls/rt_sigaction/../../../../include/ltp_signal.h:85: undefined reference to `handler_h'

---
 include/ltp_signal.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/ltp_signal.h +1 -1
index 1ac6f70..093059f 100644
@@ -69,7 +69,7 @@ struct kernel_sigaction {
 
 void (*restore_rt) (void);
 
-inline void
+void
 handler_h (int signal)
 {
 	return;
Signature · 13 lines
1.7.9.5


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw
Quoted 3 lines · Vinson Lee

This patch fixes this build error with clang.

testcases/kernel/syscalls/rt_sigaction/../../../../include/ltp_signal.h:85: undefined reference to `handler_h'

If you wanna build LTP with LLVM, why not make out "a path for LLVM building" and send out it. I think this one line change can't do everything for LLVM building, although untested. right?

Thanks,
Wanlong Gao

Quoted 12 lines
---
 include/ltp_signal.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/ltp_signal.h +0 -0
index 1ac6f70..093059f 100644

include/ltp_signal.h struct kernel_sigaction { · line 75

Quoted 8 lines
include/ltp_signal.h +1 -1
@@ -69,7 +69,7 @@ struct kernel_sigaction {
 
 void (*restore_rt) (void);
 
-inline void
+void
 handler_h (int signal)
 {
 	return;

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

author
#2 lore raw
Quoted 12 lines · Wanlong Gao
Quoted 3 lines · Vinson Lee

This patch fixes this build error with clang.

testcases/kernel/syscalls/rt_sigaction/../../../../include/ltp_signal.h:85: undefined reference to `handler_h'

If you wanna build LTP with LLVM, why not make out "a path for LLVM building" and send out it. I think this one line change can't do everything for LLVM building, although untested. right?

Thanks,
Wanlong Gao

This was the only build error with I saw with clang. This one change fixes the build with clang.

It's a C99 error which would probably occur with gcc -std=c99 as well.
http://clang.llvm.org/compatibility.html#inline

Quoted 12 lines
Quoted 12 lines
---
 include/ltp_signal.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/ltp_signal.h +0 -0
index 1ac6f70..093059f 100644
@@ -69,7 +69,7 @@ struct kernel_sigaction {
 
Quoted 9 lines

include/ltp_signal.h struct kernel_sigaction { · line 75

Quoted 8 lines
include/ltp_signal.h +1 -1
 void (*restore_rt) (void);
 
-inline void
+void
 handler_h (int signal)
 {
      return;

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
Quoted 14 lines · Vinson Lee
Quoted 12 lines · Wanlong Gao
Quoted 3 lines · Vinson Lee

This patch fixes this build error with clang.

testcases/kernel/syscalls/rt_sigaction/../../../../include/ltp_signal.h:85: undefined reference to `handler_h'

If you wanna build LTP with LLVM, why not make out "a path for LLVM building" and send out it. I think this one line change can't do everything for LLVM building, although untested. right?

Thanks,
Wanlong Gao

Quoted 5 lines

This was the only build error with I saw with clang. This one change fixes the build with clang.

It's a C99 error which would probably occur with gcc -std=c99 as well.
http://clang.llvm.org/compatibility.html#inline

I saw that "Change add to a static inline function.
This is usually the right solution if only one translation unit needs to use the function. static inline functions are always resolved within the translation unit, so you won't have to add a non-inline definition of the function elsewhere in your program."

So, why not just change it to "static inline" to resolve this?

Thanks,
Wanlong Gao

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
---
 include/ltp_signal.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/ltp_signal.h +0 -0
index 1ac6f70..093059f 100644
@@ -69,7 +69,7 @@ struct kernel_sigaction {
 
 void (*restore_rt) (void);
 
Quoted 8 lines
Quoted 7 lines

include/ltp_signal.h struct kernel_sigaction { · line 75

Quoted 6 lines
include/ltp_signal.h +1 -1
-inline void
+void
 handler_h (int signal)
 {
      return;

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#4 lore raw

Hi!

Quoted 7 lines

I saw that "Change add to a static inline function.
This is usually the right solution if only one translation unit needs to use the function. static inline functions are always resolved within the translation unit, so you won't have to add a non-inline definition of the function elsewhere in your program."

So, why not just change it to "static inline" to resolve this?

Interestingly enough, the function is passed via pointer so compiler couldn't inline it at all, I wonder why there was the inline in the first place...

I've removed the inline added static and confirmed that it builds with clang 3.1 on x86_64.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#5 lore raw
In reply to Vinson Lee

Hi!

include/ltp_signal.h struct kernel_sigaction { · line 75

Quoted 13 lines
include/ltp_signal.h +1 -1
index 1ac6f70..093059f 100644
@@ -69,7 +69,7 @@ struct kernel_sigaction {
 
 void (*restore_rt) (void);
 
-inline void
+void
 handler_h (int signal)
 {
 	return;

I've just commited similar patch to this and added your signed-of-by.

Thanks.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list