console_buffer
yet another potential cleanup:
I see both:
extern char console_buffer[];
and
extern char console_buffer[CONFIG_SYS_CBSIZE];
(and in fact console_buffer is declared as:
char console_buffer[CONFIG_SYS_CBSIZE + 1]; /* console I/O buffer */
so with a +1).
Questions:
is the first or the 2nd form preferred?
and if it is the 2nd form should it not have the +1?
and wouldn't it be better to have this extern in a .h file (and if so which one)?
Frans
Hi Frans,
Quoted 11 lines · Frans Meulenbroeks
yet another potential cleanup:
I see both:
extern char console_buffer[];
and
extern char console_buffer[CONFIG_SYS_CBSIZE];(and in fact
console_bufferis declared as:
char console_buffer[CONFIG_SYS_CBSIZE + 1]; /* console I/O buffer */
so with a +1).
Quoted 7 lines
Questions:
is the first or the 2nd form preferred?
and if it is the 2nd form should it not have the +1?
and wouldn't it be better to have this extern in a .h file (and if so which one)?
Your interest is definitely appreciated. As a general remark, you're more likely to get meaningful feedback if you just submit what you think is best. You'll get more feedback when people don't like what you did, but any EE will tell you that negative feedback is the path to stability :)
Quoted 2 lines
Frans
regards,
Ben
A message that is not in the archive (sent off-list or not yet received): [email protected]
Oops. Replied to Ben only not to the list. Here is my reply.
Actually did a quick grep -r -w afterwards: there are roughly 475 .c files with extern in it.
Guess this is a more widely spread issue.
(btw personally I feel that it is a sign of clean programming to declare all exported functions in a header file, and only to use header files to import functions, but maybe that is a personal thingie).
Frans
2010/3/24 Frans Meulenbroeks <[email protected]>:
Quoted 37 lines
2010/3/24 Ben Warren <[email protected]>:
Quoted 24 lines
Hi Frans,
Quoted 13 lines · Frans Meulenbroeks
yet another potential cleanup:
I see both:
extern char console_buffer[];
and
extern char console_buffer[CONFIG_SYS_CBSIZE];(and in fact
console_bufferis declared as:
char ? ? ? ?console_buffer[CONFIG_SYS_CBSIZE + 1]; ? ? ?/* console I/O buffer ? */
so with a +1).Quoted 7 lines
Questions:
is the first or the 2nd form preferred?
and if it is the 2nd form should it not have the +1?
and wouldn't it be better to have this extern in a .h file (and if so which one)?Quoted 4 lines
Your interest is definitely appreciated. ?As a general remark, you're more likely to get meaningful feedback if you just submit what you think is best. ?You'll get more feedback when people don't like what you did, but any EE will tell you that negative feedback is the path to stability :)
You have a point.
Well, I have not too strong opinions on this one, but I like consistency. But if I have a choice I prefer to have it in an include file (but I am not too eager to create one for this sole declaration.Frans (who actually is an EE :-) )
Hi Frans,
Quoted 4 lines
(btw personally I feel that it is a sign of clean programming to declare all exported functions in a header file, and only to use header files to import functions, but maybe that is a personal thingie).
Seconded. Any patch to this end is highly welcome ;)
Cheers
Detlev
Signature · 9 lines
I've never understood the tendency to pick up tastes because they are popular. In fact, I think it is foolish to do that. I mean, don't you know what you like? People who are so weak that they will take their tastes from people around them in the desperate desire to be accepted, I think of them as cowards. -- Richard M. Stallman -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
Dear Ben,
Quoted 3 lines · In message <[email protected]> you wrote:
... You'll get more feedback when people don't like what you did,
but any EE will tell you that negative feedback is the path to stability :)
May I add this to my list of signature quotes?
Best regards,
Wolfgang Denk
--
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 In a survey taken several years ago, all incoming freshmen at MIT were asked if they expected to graduate in the top half of their class. Ninety-seven percent responded that they did.
Quoted 10 lines · Wolfgang Denk
Dear Ben,
Quoted 3 lines · In message<[email protected]> you wrote:
... You'll get more feedback when people don't like what you did,
but any EE will tell you that negative feedback is the path to stability :)May I add this to my list of signature quotes?
Sure, under GPL v3 ;)
Quoted 4 lines
Best regards,
Wolfgang Denk
regards,
Ben