Development

共370篇文章。

bsd.port.mk: critical issue for RELENG_6

Development

Today I have submitted a PR which I have marked “critical”.bsd.port.mk does not do the right thing on RELENG_6 after the rcorder change, which will cause all ports installed rc.d scripts stop to function at system startup.

The PR can be accessed here: https://www.freebsd.org/cgi/query-pr.cgi?pr=93536

📓 Updates

  • 2006-02-19: It seems that the problem is not related to this. I am still investigating what was happening.
  • 2006-02-20: Doug Barton has kindly provided information about the issue. It was because some nojail and mountcritlocal conflict. The issue can only appear when you are using jail(8).
参与评论:bsd.port.mk: critical issue for RELENG_6

关于如何扩展复杂且难懂的C代码的一点经验谈

Development

有时,我们会希望扩展一些现有的C代码。这些代码可能经历了相当久的运行考验——它们至少目前工作起来没有问题——然而,它们可能存在各种各样的问题,比如:

  • 缺少注释。
  • 过分使用goto语句。
  • 变量名不规范。
  • 逻辑复杂难懂。
  • 过分使用表达式赋值(if (foo = bar()) {})。
  • 直接返回函数返回值(这是合法的,但会给增加功能带来困难)。

要扩展这类代码是一件有挑战的事情。

阅读全文…:关于如何扩展复杂且难懂的C代码的一点经验谈(本文约699字,阅读大致需要2分钟)

静态代码分析工具?

Development

今天一条内部消息(很快会正式公布)说我们得到了一个强悍的代码静态分析工具的授权。希望这能够为我们的开发带来新的想法,登录上去看了看,感觉很有挑战,许多似是而非的问题,到底是不是真的问题,其实都需要我们去手工地阅读代码和重新验证。

参与评论:静态代码分析工具?

Bug in Python re implementation?

Development

Python includes a Regular Expression implementation, called re. However, I thought that I have hit a bug.

The following regular expression is apparantly wrong, but Python spend much CPU time to give a mismatch:

_mailcheck = re.compile("^(\w|.){3,25}$")
_mailcheck.match("foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo")

I think the “.” would override anything (including “\w”), but this does not happen…

参与评论:Bug in Python re implementation?
搜索文章…(按ESC退出)