Minix Code style?

44 views
Skip to first unread message

Peter Shkenev

unread,
Mar 30, 2021, 8:52:32 AMMar 30
to minix-dev
Hello everyone,

I was lurking through Minix code and noticed that different parts of code are written in different styles.

We should adopt some code style for Minix. I may suggest already existing style, such as GNU or Linux style.

Best regards,
Peter

stux...@gmail.com

unread,
Apr 6, 2021, 9:38:41 AMApr 6
to minix-dev
Hi Peter,

Please be aware that the Minix wishlist currently has  " Change all K&R-style function declarations to ANSI-style declarations " as a TODO item (I suspect you've seen this already).  If you're looking for a more "general" coding standard then I'd suggest following NetBSD's coding standards as opposed to Linux since that's where most of the user space code is sourced from anyway.  It may be that they are one and the same anyway.  So far a quick search only revealed this link:

-stux

Peter Shkenev

unread,
Apr 6, 2021, 12:16:21 PMApr 6
to minix-dev
Hello Stux,

You have a point. I will implement corresponding clang-format file and probably post it here.

Best regards,
Peter

вторник, 6 апреля 2021 г. в 16:38:41 UTC+3, stux...@gmail.com:

stux...@gmail.com

unread,
Apr 7, 2021, 10:32:59 AMApr 7
to minix-dev
Okay, cool. I'm not sure what you're exactly referring to by clang-format file but I look forward to examining it.
-stux

Peter Shkenev

unread,
Apr 7, 2021, 12:24:53 PMApr 7
to minix-dev
Hello Stux,

Clang-format (part of Clang package) is a tool used for formatting the code. It can use file which describes the style. See here: https://clang.llvm.org/docs/ClangFormat.html .

There was an effort at GSoC 2019 to add NetBSD KNF support to clang-format,  but it looks like that effort wasn't successfully finished, but we have now this: https://blog.netbsd.org/tnf/entry/gsoc_2019_report_adding_netbsd1 .

Best regards,
Peter

среда, 7 апреля 2021 г. в 17:32:59 UTC+3, stux...@gmail.com:
Reply all
Reply to author
Forward
0 new messages