The branch master has been updated via 73e69696a67ccd706dae5b8359bb423febde25aa (commit) from 272b74db20a3cec1c9882f58161efa93accad094 (commit)
- Log ----------------------------------------------------------------- commit 73e69696a67ccd706dae5b8359bb423febde25aa Author: Matt Caswell <m...@openssl.org> Date: Mon Sep 14 11:26:49 2020 +0100 Add a new section to the Coding Style about argument ordering We also add a section about how to extend existing functions. Reviewed-by: Paul Dale <paul.d...@oracle.com> Reviewed-by: Richard Levitte <levi...@openssl.org> (Merged from https://github.com/openssl/web/pull/195) ----------------------------------------------------------------------- Summary of changes: policies/codingstyle.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/policies/codingstyle.txt b/policies/codingstyle.txt index db21c44..a9958f1 100644 --- a/policies/codingstyle.txt +++ b/policies/codingstyle.txt @@ -295,6 +295,23 @@ because it is a simple way to add valuable information for the reader. The name in the prototype declaration should match the name in the function definition. + Chapter 6.1: Extending existing functions + +From time to time it is necessary to extend an existing function. Typically this +will mean adding additional arguments, but it may also include removal of some. + +Where an extended function should be added the original function should be kept +and a new version created with the same name and an "_ex" suffix. For example, +the "RAND_bytes" function has an extended form called "RAND_bytes_ex". + +Where an extended version of a function already exists and a second extended +version needs to be created then it should have an "_ex2" suffix, and so on for +further extensions. + +When an extended version of a function is created the order of existing +parameters from the original function should be retained. However new parameters +may be inserted at any point (they do not have to be at the end), and no longer +required parameters may be removed. Chapter 7: Centralized exiting of functions