From 3a04e34fca1cddb328d8caedec39f6c98ad35036 Mon Sep 17 00:00:00 2001 From: Keith Thompson Date: Wed, 22 Oct 2025 17:14:06 -0700 Subject: [PATCH 1/2] [diff.expr] Remove commentary about good practice in C C deliberately supports implicit conversion from void* to object*. Using an explicit cast (for assigning the result of malloc, for example) is not considered good practice in C, though it's required in C++. I'm not aware of any C translators that warn about such assignments. --- source/compatibility.tex | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index a46c9a71cc..317b728d31 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -2996,10 +2996,8 @@ \end{example} \howwide -This is fairly widely used but it is good -programming practice to add the cast when assigning pointer-to-void to pointer-to-object. -Some C translators will give a warning -if the cast is not used. +This is fairly widely used in C, but C++ requires a +cast when assigning pointer-to-void to pointer-to-object. \diffref{expr.arith.conv} \change From 61b748f548d78dc5818791f06ce24ef8eef24d54 Mon Sep 17 00:00:00 2001 From: Keith Thompson Date: Thu, 23 Oct 2025 15:13:29 -0700 Subject: [PATCH 2/2] Update source/compatibility.tex Remove unnecessary wording. Co-authored-by: Jan Schultke --- source/compatibility.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index 317b728d31..60165bf48e 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -2996,8 +2996,7 @@ \end{example} \howwide -This is fairly widely used in C, but C++ requires a -cast when assigning pointer-to-void to pointer-to-object. +Common. \diffref{expr.arith.conv} \change