Skip to contentSkip to conversation

Bugs in newest patches

PATCH Applied Keunhong Lee 3 participants 6 messages Nov 6, 2014 – Nov 7, 2014 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi.
I just pulled new patches from the master branch, and found that it doesn't work with C++.

in lib/librte_eal/common/include/generic/rte_cycles.h missing opening extern "C" in
commit fa4001c30ee9d9ecfb3ca5d93d68ef0394e9950a

here is the fix.

-----

* Simple Time Reference Functions (Cycles and HPET). */

+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdint.h>
#include <rte_debug.h>
#include <rte_atomic.h>

----

Keunhong.

A message that is not in the archive (sent off-list or not yet received): CAKBXKmBUgTBWvMnQEfE_nms7p9v32edwa2V2oVuwZrx+ZRhPrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#2 lore raw

Hi,

2014-11-07 05:21, Keunhong Lee:

Review

Quoted 7 lines

I just pulled new patches from the master branch, and found that it doesn't work with C++.

in lib/librte_eal/common/include/generic/rte_cycles.h

(quoted diff) +3 -0
+#ifdef __cplusplus
+extern "C" {
+#endif

It's already included in lib/librte_eal/common/include/arch/x86/rte_cycles.h which includes lib/librte_eal/common/include/generic/rte_cycles.h.

You shouldn't include the generic header directly.

Signature · 1 line
Thomas
#3 lore raw

I did not included the generic header directly.
I thought that this nested "extern C" is intended, however, according to your reply, this might be removed at all.

There is a remaining
"""
#ifdef _cplusplus
}
#endif
"""
at the end of "generic/rte_cycles.h".
I think this should be removed. This causes compile error on C++.

Keunhong.

2014-11-07 6:05 GMT+09:00 Thomas Monjalon <[email protected]>:

Quoted 21 lines

Hi,

2014-11-07 05:21, Keunhong Lee:

Quoted 1 line

I just pulled new patches from the master branch, and found that it

doesn't

Review

Quoted 6 lines

work with C++.

in lib/librte_eal/common/include/generic/rte_cycles.h

(quoted diff) +3 -0
+#ifdef __cplusplus
+extern "C" {
+#endif

It's already included in lib/librte_eal/common/include/arch/x86/rte_cycles.h which includes lib/librte_eal/common/include/generic/rte_cycles.h.

You shouldn't include the generic header directly.

--
Thomas

A message that is not in the archive (sent off-list or not yet received): CAKBXKmD7qRTHU-VmdNMAvpTnAAMuD5ZxTqoj5VUr3v4FKa6XTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#5 lore raw

Hello,

Quoted 4 lines · Keunhong Lee

I did not included the generic header directly.
I thought that this nested "extern C" is intended, however, according to your reply, this might be removed at all.

Quoted 9 lines

There is a remaining
"""
#ifdef _cplusplus
}
#endif
"""
at the end of "generic/rte_cycles.h".
I think this should be removed. This causes compile error on C++.

Argh, good catch.
I will send a fix (it looks to be the only one remaining).

Signature · 1 line
David Marchand
#6 lore raw

PATCH 1/1 eal: fix C++ compilation issue after headers rework

In reply to a message not in the archive

Following the big headers rework, all C++ stuff has moved to arch-specific headers. The generic headers should not contain this so that this is done only once.
There was a remaining #ifdef __cplusplus in "eal: split CPU cycle operation to architecture specific" (fa4001c30ee9).

---
 lib/librte_eal/common/include/generic/rte_cycles.h | 4 ----
 1 file changed, 4 deletions(-)
lib/librte_eal/common/include/generic/rte_cycles.h +0 -4
index c42b90b..7700f41 100644
@@ -202,8 +202,4 @@ rte_delay_ms(unsigned ms)
 	rte_delay_us(ms * 1000);
 }
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* _RTE_CYCLES_H_ */
Signature · 1 line
2.1.1

A message that is not in the archive (sent off-list or not yet received): 1415341580-28210-1-git-send-email-david.marchand-pdR9zngts4EAvxtiuMwx3w@public.gmane.org

Acked-by Applied
#8 lore raw

Re: [PATCH] eal: fix C++ compilation issue after headers rework

Quoted 8 lines

Following the big headers rework, all C++ stuff has moved to arch-specific headers. The generic headers should not contain this so that this is done only once.
There was a remaining #ifdef __cplusplus in "eal: split CPU cycle operation to architecture specific" (fa4001c30ee9).

Applied

Thanks

Signature · 1 line
Thomas