linux内核编程pdf下载,linux内核编程风格.pdf

62e50291a81fc54b507f33cb80033297.gif

linux内核编程风格.pdf

(20页)

2c7d13f4b085db084ddd396292dbfe35.gif

本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦!

15.9 积分

Linux kernel coding styleThis is a short document describing the preferred coding style for thelinux kernel. Coding style is very personal, and I won't _force_ myviews on anybody, but this is what goes for anything that I have to beable to maintain, and I'd prefer it for most other things too. Pleaseat least consider the points made here.First off, I'd suggest printing out a copy of the GNU coding standards,and NOT read it. Burn them, it's a great symbolic gesture.Anyway, here goes: Chapter 1: IndentationTabs are 8 characters, and thus indentations are also 8 characters.There are heretic movements that try to make indentations 4 (or even 2!)characters deep, and that is akin to trying to define the value of PI tobe 3.Rationale: The whole idea behind indentation is to clearly define wherea block of control starts and ends. Especially when you've been lookingat your screen for 20 straight hours, you'll find it a lot easier to seehow the indentation works if you have large indentations.Now, some people will claim that having 8-character indentations makesthe code move too far to the right, and makes it hard to read on a80-character terminal screen. The answer to that is that if you needmore than 3 levels of indentation, you're screwed anyway, and should fixyour program.In short, 8-char indents make things easier to read, and have the addedbenefit of warning you when you're nesting your functions too deep.Heed that warning.The preferred way to ease multiple indentation levels in a switch statement is

关 键 词:

linux 内核 编程 风格

524d6daf746efaa52c3c71bbfe7ba172.gif

天天文库所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。

关于本文

本文标题:linux内核编程风格.pdf

链接地址:

https://www.wenku365.com/p-51491764.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值