From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id B8657469C1 for ; Thu, 31 Aug 2023 15:29:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1387D68C7A6; Thu, 31 Aug 2023 18:28:58 +0300 (EEST) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ABA7968C6CB for ; Thu, 31 Aug 2023 18:28:51 +0300 (EEST) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3fe4cdb72b9so10207615e9.0 for ; Thu, 31 Aug 2023 08:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693495730; x=1694100530; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=ydjcoqpuLDGq8QmTP7PTBxoW1DukLSw+/N579nh2Ev8=; b=FEEkrhDAucEn3LzoOqJeuCUhxHOyJGpvhDV2A0cBjuhq1uBJ5+rKICC3pbiOQzMtJ4 svvBjaO0CKYbWs6yfYLQ8uNRysNfBbAz9QI8xva0VHPf5RsN+YUDggUUh6WHt3tIEU80 TjpnV2JLNlhUTUpUAUBVDA8ByF6Zv+ttHlL6GUmvJrvh5JPZWvzDy7visu+bUlP7KGiJ jFsa2xB4ynGKTjFfCr0i7WaMeSSansPKT1AXsH4o7A1W85t+tlkH/bZuHRHyh0R5aMoZ FtqcMqpvICqcqOpIs+uGW3RBG+oY23EHfAJT8FUG1VQQXCx/B/zKXQEXhlm7ppNSnJ/W m9IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693495730; x=1694100530; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ydjcoqpuLDGq8QmTP7PTBxoW1DukLSw+/N579nh2Ev8=; b=dMlY5tQbRdvpnFsICqTEYpp3Q+iQisM3gYX9182Dho9CUs3mK5dX2rjXiQw5tM2FI5 AhezFqoHlyOAGB7iti0GFrVj0Mlhz/W8vuZOEcDIuZW6qgtDh+40pasqQoYPpUw9Ci97 LYeLs/THIzGsHthJAUeX0IDr2xf+qz5Msx6Q+PhW9q/ApC8A/7rKwMn5egjw9k2/jFh4 ecGzp7dcXVqw+Z3t0jqWHmfxYBteUOV0+vf/nyAnSo6ailI7VS5M1vBLtOd9w4vPWgbZ klMvYWJIt+hVasek3SGUTzcM7hoIqmb9RiCTd2ApcllaVxGj6aT8M1FzoRrgFdGL/VsQ 7sGA== X-Gm-Message-State: AOJu0Yx8S/2QfuUJXArdF+Moj9aZ8qWo1XOx4MYS/dROK2o3AYmQG84w HjHCKkjupaAh3ng/xT464Rb/DMK+tLI= X-Google-Smtp-Source: AGHT+IGfswjbWaoJu1IjdezTdaTNJSy4/9cs35bLSR4ry1rzLSiwj3IFdapyFCvbIclcIwBhwJAHmw== X-Received: by 2002:a05:6000:10c7:b0:31d:3669:1c54 with SMTP id b7-20020a05600010c700b0031d36691c54mr4384463wrx.56.1693495730200; Thu, 31 Aug 2023 08:28:50 -0700 (PDT) Received: from mariano ([82.84.194.139]) by smtp.gmail.com with ESMTPSA id d18-20020a5d5392000000b0031c6e1ea4c7sm2590019wrv.90.2023.08.31.08.28.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 08:28:49 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 18701BFCDA; Thu, 31 Aug 2023 17:28:48 +0200 (CEST) Date: Thu, 31 Aug 2023 17:28:48 +0200 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: <20230826180748.15977-1-anton@khirnov.net> <20230826180748.15977-4-anton@khirnov.net> <169329808575.20400.4593289958410673620@lain.khirnov.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <169329808575.20400.4593289958410673620@lain.khirnov.net> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH 4/6] doc/developer: add a code behaviour section to development policy X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On date Tuesday 2023-08-29 10:34:45 +0200, Anton Khirnov wrote: > Quoting Stefano Sabatini (2023-08-27 14:38:44) > > Il sab 26 ago 2023, 20:08 Anton Khirnov ha scritto: > > > > > Document our longstanding de facto policies on things like correctness, > > > thread-safety, UB, etc. > > > > > > > UB? > > undefined behavior yes, let's avoid acronyms > > > > > --- > > > doc/developer.texi | 50 +++++++++++++++++++++++++++++++++------------- > > > 1 file changed, 36 insertions(+), 14 deletions(-) > > > > > > diff --git a/doc/developer.texi b/doc/developer.texi > > > index df43119f98..afa0148137 100644 > > > --- a/doc/developer.texi > > > +++ b/doc/developer.texi > > > @@ -274,10 +274,6 @@ symbols. If in doubt, just avoid names starting with > > > @code{_} altogether. > > > @section Miscellaneous conventions > > > > > > @itemize @bullet > > > -@item > > > -fprintf and printf are forbidden in libavformat and libavcodec, > > > -please use av_log() instead. > > > - > > > @item > > > Casts should be used only when necessary. Unneeded parentheses > > > should also be avoided if they don't make the code easier to understand. > > > @@ -286,6 +282,42 @@ should also be avoided if they don't make the code > > > easier to understand. > > > @anchor{Development Policy} > > > @chapter Development Policy > > > > > > +@section Code behaviour > > > + > > > +@subheading Correctness > > > +The code must be valid. It must not crash, abort, access invalid > > > pointers, leak > > > +memory, cause data races or signed integer overflow, or otherwise invoke > > > +undefined behaviour. > > > > > > Invoke => assume? > > No, 'assume' would mean something else. 'cause' maybe. "cause" sounds good. > > > > > Error codes should be checked and, when applicable, > > > +forwarded to the caller. > > > + > > > +@subheading Thread- and library-safety > > > +Our libraries may be called by multiple independent callers in the same > > > process. > > > +These calls may happen from any number of threads and the different call > > > sites > > > +may not be aware of each other - e.g. a user program may be calling us > > > directly, > > > > > > > Calling us -> calling the/our libraries > > I wanted to avoid using the word 'libraries' multiple times, to avoid > possible confusion of which library is being talked about - whether ours > or some external one. But using "us" is even more confusing (who/what is "us"?), I have no better ideas than repeating "our/the FFmpeg libraries". _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".