zanshinAre the rules because Linus wants them that way or are they based on something else?
jmgvand class if you use c++ i suppose
snide13min too late ;-(
jmgvalthough c++ is not used at kernel :-)
gccthe proper way to break a too long line
riel_jmgv: the kernel is object oriented in places, for example the VFS
riel_jmgv: but as Alan said it very nicely, object orientation is in the mind, not in the compiler
jmgvhow mandatory are these rules. I mean,... if i send a patch to be include at kernel, and i use 4 space
tab instead 8 space ones, is it mean the patch could be back to me for that reason?
jmgvriel_ okey i see
riel_jmgv: imagine a driver with 4 different programming styles in one .c file ;)
mulixhow about patches to clean up the coding style of old drivers?
mulixare those a waste of time, or appreciated?
mulixdrivers/net/eepro100.c comes to mind...
jmgvriel_ i see :-) it will be a curious kaos
snidewhat about the unicity of the different function names all over the code ? is it a good thing, a bad
thing, a have-to ?
bhuniqueness maybe?
snideyes
snidesorry about my english...
gregkhno problem.
sarnoldso, how about typedef? :)
davej(unless you're ingo)
gccwhy it so evil
viXardumm, sorry
viXardyou meant evil?
borenhey what about typedef for function pointer definitions?  
gccgot it
zanshinwhat is bad about passing structures as parameters?
zanshinthe stacksize?
sarnoldzanshin: the kernel stack is only 8k...
snidegot disconnected sorry [ could someone be kind and msg me the reply -if there where any- ]
bhyou can pass a pointer to the structure, which saves memory, I think
zanshink thanks
sarnoldsnide: 10:25 <@gregkh:#linux> yes, pick your function names well, and don't make them global unless
they have to be.
snidesarnold: thx
gregkhany other questions while the translation catches up?
riel_sorry about the little split
tiriIt doesn't matter
viXardgregkh you can continue :-)
snidebtw, how to make a function "global" ? put in in a .h ? or EXPORT ?
cdubsnide: global within kernel...non static definition in a c file, and an extern in a .h is good enough.
snidebut what about #ifdef CONFIG_SMP inside mm/slab.c for exemple
cdubEXPORT_SYMBOL is needed if you want modules to be able to use it
snideoops, i'm getting quoted too much...
snide;-)
zanshinis that the same as: struct foo = {
zanshinread: func(),
zanshin}
sarnoldzanshin, that is the GNU version... it is deprecated in favour of the new style..
cdubzanshin: yes
snidehow to avoid using #ifdef CONFIG_MYOPTION in a practical way then [ any exemple ? ]
zanshinah okay
zanshinany reason for that... just curious.
sarnoldthe newer format was standardized in C99.. why they didn't just take the GNU format, I have no idea. :)
cdubzanshin: gcc deprepated the use.  you get warnings with newer compilers
zanshinI see
snideso better split up the .c files ?
snideso using a function that the content will be wiped out with an #ifdef ?
snidegregkh: u should continue the talk, i don't want to hog u ;-)
gregkhsnide: that's it, I'm done unless there are more questions :)
snidegregkh: ok ;-) so, i'll go through the URL and files that u pointed at
jmgvone question
gregkhsure.
jmgvif i think i can contribute with some other rules i think can improve the code style or....
snidegregkh: thx a lot
jmgvi think one of them can be changed, where i can send my arguments?
gregkhjmgv: to the linux kernel mailing list, but be prepared to back them up :)
jmgv:-) okey
sarnoldjmgv: you aren't going to convince them to switch to C++ :)
cdubheh
snidesarnold: maybe C# then  ;-))
jmgvi am starting to be convinced to switch to C :-)
racielhehe, C# would be an option! :)
snidesarnold: (in link with the Mono talk we had)
gccgregkh: just one more
gcc> Some notes:
gcc> - coding style: linux functions usually have only one return at the end
gcc> of the function, and goto internally.
gccsee this on the LKML
snidejmgv: C is rather unfrienldy, but it does much less magic behind ur back than C++ ;-) and that's good
for an OS [ IHMO ]
gccsaw
jmgvsnide: sure!
gregkhgcc: ah, good point, I'll add that one to my list.  It's a good thing to do.
snidegcc: it's easier to track the exit point that way ;-)
gccsnide: yeah, i allways use this, but always have some one saying that goto is lame
snidealthough my C professor would jump if he sees a "goto" ;-)
racielgregkh: can you explain me what is data alignment and show me some example of that?
snidegcc: goto is good if it help to follow a up-down algorithm path
gregkhraciel: data alignment, like padding or packing data structures?
snidegcc: quoted from Rusty's inline kernel docbooks
snide;-)
racielgregkh: packing data structures
snidefernand0: will there be a bibliography web page on the web site ?
fernand0mmmm
fernand0there will be whichever the authors provide
fernand0of course, any links and references provided during the talk will be in the logs
snidefernand0: sure, but i thought about a web page with all the links collected ;-)
gregkhraciel: hold on, I have a good reference for that...
racielok
fernand0colledcted or extracted ?
snidefernand0: a page that one can bookmark ;-p
gregkhraciel: see http://www.linuxjournal.com/article.php?sid=5783 for all about that.
snidefernand0: extracted [ my english is poor ;-( ]
fernand0mine is also poor
snidefernand0: seems better than mine ;-p
fernand0but i do not understand well
fernand0you are meaning a page with the links of this talk ?
snidefernand0: u got the point ;-)
fernand0i don't think so
fernand0but it sounds as a good idea
twinhola a todos
fernand0maybe we should think about it
FJxgregkh, this is a little off-topic question but... can you recommend me any good begginer's book for
Programming in Linux? or just plain ANSI C?
fernand0it shouldn't be difficult to extract them
snidefernand0: i know there isn't one here yet ;-) but i wondered if it is something that will appear ;-p
fernand0we'l try
snidefernand0: i'll even do it if u want [ by hand, since it's not a HUGE task ;-p ]
gccwell, got to work...
fernand0but just in case ... dowload the logs and grep http the_log.html
fernand0hehe
gccgregkh: thanks for the lecture... very nice..
gregkhgcc: no problem, was fun.  you all were an easy audience :)
snidegcc: yeah, the talks are of a really good quality ;-p
sarnold          http://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_paper/codingstyle.ps
sarnoldhttp://www.kroah.com/linux/talks/ols_2002_kernel_codingstyle_talk/html/
sarnoldthose are the two urls gregkh mentioned :)
snidegregkh: execpt me ;-p [ ways too much questions ]
racielgregkh: other question, what technics do you use to debug your code? kdb? printk..?
sarnoldsnide: i didn't think so... one nice feature of IRC conferences is that one can reach high levels of
interactions
gregkhthere's also other assorted ramblings that I've written lined off of http://www.kroah.com/linux/
snidesarnold: ow... another valuable URL ;-p
gregkhraciel: printk mostly.  haven't had to use a debugger yet, I do drivers, so debuggers don't help out
all that much at times with hardware.
snidesarnold: yeah. it's the first IRC conf i'm doing, and it is wonderful ;-p
fernand0leaving

Generated by irclog2html.pl by Jeff Waugh - find it at freshmeat.net!