/* inside comment in libfdt.h
Hi,
I just tested the current master branch after Wolfgang recent custodian merge and noticed some errors that are caused by comments inside comments.
Possibly this can be switched of by a compiler switch or the code has never passed compilation. With ELDK's gcc 4.0.0 (ELDK 4.1.0) at least I run into trouble.
What about this solution:
include/libfdt.h +2 -2
@@ -544,7 +544,7 @@ int fdt_parent_offset(const void *fdt, int nodeoffset);* offset = fdt_node_offset_by_prop_value(fdt, -1, propname, * propval, proplen); * while (offset != -FDT_ERR_NOTFOUND) { -* /* other code here */ +* ... other code here ... * offset = fdt_node_offset_by_prop_value(fdt, offset, propname, * propval, proplen); * }
@@ -629,7 +629,7 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset,* idiom can be used: * offset = fdt_node_offset_by_compatible(fdt, -1, compatible); * while (offset != -FDT_ERR_NOTFOUND) { -* /* other code here */ +* ... other code here ... * offset = fdt_node_offset_by_compatible(fdt, offset, compatible); * } *
Matthias
Signature · 5 lines
----------------------------------------------------------------------- Dipl.-Ing. Matthias Fuchs esd electronic system design gmbh http://www.esd-electronics.com Vahrenwalder Str. 207 phone: +49-511-37298-0, fax: -68 30165 Hannover, Germany -----------------------------------------------------------------------
Quoted 33 lines · Matthias Fuchs
Hi,
I just tested the current master branch after Wolfgang recent custodian merge and noticed some errors that are caused by comments inside comments.
Possibly this can be switched of by a compiler switch or the code has never passed compilation. With ELDK's gcc 4.0.0 (ELDK 4.1.0) at least I run into trouble.
What about this solution:
include/libfdt.h +2
-2@@ -544,7 +544,7 @@ int fdt_parent_offset(const void *fdt, int nodeoffset);* offset = fdt_node_offset_by_prop_value(fdt, -1, propname, * propval, proplen); * while (offset != -FDT_ERR_NOTFOUND) { -* /* other code here */ +* ... other code here ... * offset = fdt_node_offset_by_prop_value(fdt, offset, propname, * propval, proplen); * } @@ -629,7 +629,7 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset,* idiom can be used: * offset = fdt_node_offset_by_compatible(fdt, -1, compatible); * while (offset != -FDT_ERR_NOTFOUND) { -* /* other code here */ +* ... other code here ... * offset = fdt_node_offset_by_compatible(fdt, offset, compatible); * } *
Quoted 1 line
Matthias
Yes, nested comments is something that should not be done and should be fixed. This was inherited from the original code, although the current version uses // for the embedded comment which avoids the issue (but causes "no C++ comments" people to break out in rashes).
Hmm, interesting, the original appears to have always used //, so it would appear that we (u-booties) did the change to /* */.
<http://jdl.com/git_repos/?p=dtc.git;a=commitdiff;h=53acf491e9d576519f97b62984762498f9453cb4>
I'll have to look at this further.
My inclination is to change to embedded // comments to avoid drifting from the original due to aesthetics rather than due to necessary functionality differences.
The alternative would be to convince David Gibson (/jdl) to adopt the ...other code here... change. I prefer the ... change if it matters - if somebody blindly cuts and pastes the example code, it won't compile until he understands and edits what he pasted.
Thanks,
gvb
On Wednesday 02 January 2008 14:13, Jerry Van Baren wrote:
C++ style comments inside comments are no comments :-)
I could life with //, but if people do cut'n'paste we get // in our code - and 'ubooties' know not to use C++ style comments.
When the original source uses //, we should keep that in order to stay in sync with that code. If the U-Boot community will start to stone us, the solution is ....
Wolfgang, do you accept the change back to //?
Matthias
Quoted 25 lines
Yes, nested comments is something that should not be done and should be fixed. This was inherited from the original code, although the current version uses // for the embedded comment which avoids the issue (but causes "no C++ comments" people to break out in rashes).
Hmm, interesting, the original appears to have always used //, so it would appear that we (u-booties) did the change to /* */.
<http://jdl.com/git_repos/?p=dtc.git;a=commitdiff;h=53acf491e9d576519f97b62984762498f9453cb4>
I'll have to look at this further.My inclination is to change to embedded // comments to avoid drifting from the original due to aesthetics rather than due to necessary functionality differences.
The alternative would be to convince David Gibson (/jdl) to adopt the ...other code here... change. I prefer the ... change if it matters - if somebody blindly cuts and pastes the example code, it won't compile until he understands and edits what he pasted.
Thanks,
gvb
Signature · 5 lines
----------------------------------------------------------------------- Dipl.-Ing. Matthias Fuchs esd electronic system design gmbh http://www.esd-electronics.com Vahrenwalder Str. 207 phone: +49-511-37298-0, fax: -68 30165 Hannover, Germany -----------------------------------------------------------------------
Quoted 6 lines · Jerry Van Baren
Yes, nested comments is something that should not be done and should be fixed. This was inherited from the original code, although the current version uses // for the embedded comment which avoids the issue (but causes "no C++ comments" people to break out in rashes).
Woah, hey! That's me!
Uh...
Quoted 5 lines
Hmm, interesting, the original appears to have always used //, so it would appear that we (u-booties) did the change to /* */.
<http://jdl.com/git_repos/?p=dtc.git;a=commitdiff;h=53acf491e9d576519f97b62984762498f9453cb4>
I'll have to look at this further.
Quoted 8 lines
My inclination is to change to embedded // comments to avoid drifting from the original due to aesthetics rather than due to necessary functionality differences.
The alternative would be to convince David Gibson (/jdl) to adopt the ...other code here... change. I prefer the ... change if it matters - if somebody blindly cuts and pastes the example code, it won't compile until he understands and edits what he pasted.
Oh man....
OK. For the record, I'm all for only comments like this:
/*
*
*/Clearly lax, I'll start enforcing it on the DTC sources more.
Sorry.
jdl
Quoted 11 lines · Jon Loeliger
Oh man....
OK. For the record, I'm all for only comments like this:
/* * */Clearly lax, I'll start enforcing it on the DTC sources more.
Sorry.
Yes, because putting up with the inability to nest comments is clearly worth avoiding something that came from a language with cooties.
-Scott
Quoted 7 lines · Jon Loeliger
Quoted 5 lines · Jerry Van Baren
Yes, nested comments is something that should not be done and should be fixed. This was inherited from the original code, although the current version uses // for the embedded comment which avoids the issue (but causes "no C++ comments" people to break out in rashes).
Quoted 5 lines
Woah, hey! That's me!
Uh...
Stop. Take a deep breath. It really wasn't you, just had your fingerprints because you touched it last. I referenced your repository as the convenient/canonical repository for dtc/libfdt.
[snip]
Quoted 8 lines
Oh man....
OK. For the record, I'm all for only comments like this:
/* * */
Quoted 5 lines
Clearly lax, I'll start enforcing it on the DTC sources more.
Sorry.
jdl
FWIIW, the misdeed was the sample code embedded inside the comment had a (sample) commented line "// add code here" which was done with a C++ // comment so that it didn't run afoul of the C compiler's no nested comments rule. A certain dignitary who breaks out in a rash when he sees // comments made a "trivial" change to a /* */ comment, which then caused the C compiler to throw a hissy fit because it now *was* a nested comment.
All in all, a comedy of good intentions. No Code Was Harmed(R) in the making of this patch sequence.
HTH,
gvb
(R)
<http://www.americanhumane.org/site/PageServer?pagename=faqs_film_end_credit>
P.S. :-D, but you knew that already.
Quoted 18 lines · Jerry Van Baren
Quoted 9 lines · Jon Loeliger
On Wed, 2008-01-02 at 07:13, Jerry Van Baren wrote:
Oh man....
OK. For the record, I'm all for only comments like this:/* * */Clearly lax, I'll start enforcing it on the DTC sources more. Sorry.
jdlFWIIW, the misdeed was the sample code embedded inside the comment had a (sample) commented line "// add code here" which was done with a C++ // comment so that it didn't run afoul of the C compiler's no nested comments rule. A certain dignitary who breaks out in a rash when he sees // comments made a "trivial" change to a /* */ comment, which then caused the C compiler to throw a hissy fit because it now *was* a nested comment.
Quoted 2 lines
All in all, a comedy of good intentions. No Code Was Harmed(R) in the making of this patch sequence.
Oh dear. Yes, I believe those '//' were deliberate to avoid nested comments. Think of them as pseudo-code, not C++ if that makes it any more palatable.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Hi you guys,
I love reading this list. Thanks Matthias - for making this thread possible.
Wolfgang, what about a 'best thread of the month/year' award.
:-)
Matthias
Quoted 8 lines · Matthias Fuchs
Hi you guys,
I love reading this list. Thanks Matthias - for making this thread possible.
Wolfgang, what about a 'best thread of the month/year' award.
:-)
Matthias
Calvin: "I try to make everyone's day a little more surreal." The Essential Calvin and Hobbes, p152-3
<http://www.calvin-and-hobbes.org/information/quotes>
:-D
gvb
Quoted 8 lines · Matthias Fuchs
Hi you guys,
I love reading this list. Thanks Matthias - for making this thread possible.
Wolfgang, what about a 'best thread of the month/year' award.
:-)
Matthias
Man, we're only 3 or 4 days into the year and
I'm already participating in Award Nominatable
Mail Threads!
Sweet.
jdl
Quoted 6 lines · In message <[email protected]> you wrote:
I just tested the current master branch after Wolfgang recent custodian merge and noticed some errors that are caused by comments inside comments.
Possibly this can be switched of by a compiler switch or the code has never passed compilation. With ELDK's gcc 4.0.0 (ELDK 4.1.0) at least I run into trouble.
You are right, mea culpa. Fix is checked in.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de There is nothing in this world constant but inconstancy. - Swift