* [Buildroot] [PATCH] dhrystone: add patch with forward declarations for functions
@ 2024-06-27 10:34 Steffen Persvold
2024-07-15 9:28 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 3+ messages in thread
From: Steffen Persvold @ 2024-06-27 10:34 UTC (permalink / raw)
To: buildroot; +Cc: Steffen Persvold
GCC14 will give errors for missing function declarations and
missing return types :
dhry_1.c:75:1: error: return type defaults to ‘int’ [-Wimplicit-int]
75 | main(int argc, char *argv[])
| ^~~~
dhry_1.c: In function ‘main’:
dhry_1.c:159:5: error: implicit declaration of function ‘Proc_5’ [-Wimplicit-function-declaration]
159 | Proc_5();
| ^~~~~~
Signed-off-by: Steffen Persvold <spersvold@gmail.com>
---
package/dhrystone/0006-fwd-decl.patch | 121 ++++++++++++++++++++++++++
1 file changed, 121 insertions(+)
create mode 100644 package/dhrystone/0006-fwd-decl.patch
diff --git a/package/dhrystone/0006-fwd-decl.patch b/package/dhrystone/0006-fwd-decl.patch
new file mode 100644
index 00000000..830a704c
--- /dev/null
+++ b/package/dhrystone/0006-fwd-decl.patch
@@ -0,0 +1,121 @@
+diff --git a/dhry_1.c b/dhry_1.c
+index 3ed1716b..61c3d908 100644
+--- a/dhry_1.c
++++ b/dhry_1.c
+@@ -32,6 +32,7 @@ int Arr_2_Glob [50] [50];
+ extern char *malloc ();
+ #endif
+ Enumeration Func_1 ();
++Boolean Func_2 ();
+ /* forward declaration necessary since Enumeration may not simply be int */
+
+ #ifndef REG
+@@ -71,8 +72,17 @@ float Microseconds,
+
+ /* end of variables for time measurement */
+
+-
+-main(int argc, char *argv[])
++/* forward declarations */
++void Proc_1 ();
++void Proc_2 ();
++void Proc_3 ();
++void Proc_4 ();
++void Proc_5 ();
++void Proc_6 ();
++void Proc_7 ();
++void Proc_8 ();
++
++int main(int argc, char *argv[])
+ /*****/
+
+ /* main program, corresponds to procedures */
+@@ -295,7 +305,7 @@ main(int argc, char *argv[])
+ }
+
+
+-Proc_1 (Ptr_Val_Par)
++void Proc_1 (Ptr_Val_Par)
+ /******************/
+
+ REG Rec_Pointer Ptr_Val_Par;
+@@ -329,7 +339,7 @@ REG Rec_Pointer Ptr_Val_Par;
+ } /* Proc_1 */
+
+
+-Proc_2 (Int_Par_Ref)
++void Proc_2 (Int_Par_Ref)
+ /******************/
+ /* executed once */
+ /* *Int_Par_Ref == 1, becomes 4 */
+@@ -352,7 +362,7 @@ One_Fifty *Int_Par_Ref;
+ } /* Proc_2 */
+
+
+-Proc_3 (Ptr_Ref_Par)
++void Proc_3 (Ptr_Ref_Par)
+ /******************/
+ /* executed once */
+ /* Ptr_Ref_Par becomes Ptr_Glob */
+@@ -367,7 +377,7 @@ Rec_Pointer *Ptr_Ref_Par;
+ } /* Proc_3 */
+
+
+-Proc_4 () /* without parameters */
++void Proc_4 () /* without parameters */
+ /*******/
+ /* executed once */
+ {
+@@ -379,7 +389,7 @@ Proc_4 () /* without parameters */
+ } /* Proc_4 */
+
+
+-Proc_5 () /* without parameters */
++void Proc_5 () /* without parameters */
+ /*******/
+ /* executed once */
+ {
+@@ -399,5 +409,3 @@ register int l;
+ while (l--) *d++ = *s++;
+ }
+ #endif
+-
+-
+diff --git a/dhry_2.c b/dhry_2.c
+index 63a3d3ea..23486c6c 100644
+--- a/dhry_2.c
++++ b/dhry_2.c
+@@ -26,8 +26,9 @@
+ extern int Int_Glob;
+ extern char Ch_1_Glob;
+
++Boolean Func_3 ();
+
+-Proc_6 (Enum_Val_Par, Enum_Ref_Par)
++void Proc_6 (Enum_Val_Par, Enum_Ref_Par)
+ /*********************************/
+ /* executed once */
+ /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
+@@ -61,7 +62,7 @@ Enumeration *Enum_Ref_Par;
+ } /* Proc_6 */
+
+
+-Proc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
++void Proc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
+ /**********************************************/
+ /* executed three times */
+ /* first call: Int_1_Par_Val == 2, Int_2_Par_Val == 3, */
+@@ -81,7 +82,7 @@ One_Fifty *Int_Par_Ref;
+ } /* Proc_7 */
+
+
+-Proc_8 (Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
++void Proc_8 (Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
+ /*********************************************************************/
+ /* executed once */
+ /* Int_Par_Val_1 == 3 */
+@@ -189,4 +190,3 @@ Enumeration Enum_Par_Val;
+ else /* not executed */
+ return (false);
+ } /* Func_3 */
+-
--
2.40.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] dhrystone: add patch with forward declarations for functions
2024-06-27 10:34 [Buildroot] [PATCH] dhrystone: add patch with forward declarations for functions Steffen Persvold
@ 2024-07-15 9:28 ` Thomas Petazzoni via buildroot
2024-08-20 20:05 ` Peter Korsgaard
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-15 9:28 UTC (permalink / raw)
To: Steffen Persvold; +Cc: buildroot
Hello,
On Thu, 27 Jun 2024 12:34:40 +0200
Steffen Persvold <spersvold@gmail.com> wrote:
> GCC14 will give errors for missing function declarations and
> missing return types :
>
> dhry_1.c:75:1: error: return type defaults to ‘int’ [-Wimplicit-int]
> 75 | main(int argc, char *argv[])
> | ^~~~
> dhry_1.c: In function ‘main’:
> dhry_1.c:159:5: error: implicit declaration of function ‘Proc_5’ [-Wimplicit-function-declaration]
> 159 | Proc_5();
> | ^~~~~~
>
> Signed-off-by: Steffen Persvold <spersvold@gmail.com>
> ---
> package/dhrystone/0006-fwd-decl.patch | 121 ++++++++++++++++++++++++++
> 1 file changed, 121 insertions(+)
> create mode 100644 package/dhrystone/0006-fwd-decl.patch
Thanks for your contribution!
The patch added by your patch was missing a Signed-off-by line and an
Upstream tag, so I've added that. Also your commit message was missing
a reference to the autobuilder failure being fixed by this. I addressed
both issues when applying.
I did a preparation patch to clean-up the existing patches a bit:
https://gitlab.com/buildroot.org/buildroot/-/commit/95013777cf93548eee7ac3010b513d354e8b0a30
And then applied your patch with the fixes described above:
https://gitlab.com/buildroot.org/buildroot/-/commit/3847a145c23234b3bddae3a9ceb9d2d4e6a90fc5
Thanks a lot for your contribution!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] dhrystone: add patch with forward declarations for functions
2024-07-15 9:28 ` Thomas Petazzoni via buildroot
@ 2024-08-20 20:05 ` Peter Korsgaard
0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-08-20 20:05 UTC (permalink / raw)
To: Thomas Petazzoni via buildroot; +Cc: Steffen Persvold, Thomas Petazzoni
>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:
> Hello,
> On Thu, 27 Jun 2024 12:34:40 +0200
> Steffen Persvold <spersvold@gmail.com> wrote:
>> GCC14 will give errors for missing function declarations and
>> missing return types :
>>
>> dhry_1.c:75:1: error: return type defaults to ‘int’ [-Wimplicit-int]
>> 75 | main(int argc, char *argv[])
>> | ^~~~
>> dhry_1.c: In function ‘main’:
>> dhry_1.c:159:5: error: implicit declaration of function ‘Proc_5’ [-Wimplicit-function-declaration]
>> 159 | Proc_5();
>> | ^~~~~~
>>
>> Signed-off-by: Steffen Persvold <spersvold@gmail.com>
>> ---
>> package/dhrystone/0006-fwd-decl.patch | 121 ++++++++++++++++++++++++++
>> 1 file changed, 121 insertions(+)
>> create mode 100644 package/dhrystone/0006-fwd-decl.patch
> Thanks for your contribution!
> The patch added by your patch was missing a Signed-off-by line and an
> Upstream tag, so I've added that. Also your commit message was missing
> a reference to the autobuilder failure being fixed by this. I addressed
> both issues when applying.
> I did a preparation patch to clean-up the existing patches a bit:
> https://gitlab.com/buildroot.org/buildroot/-/commit/95013777cf93548eee7ac3010b513d354e8b0a30
> And then applied your patch with the fixes described above:
> https://gitlab.com/buildroot.org/buildroot/-/commit/3847a145c23234b3bddae3a9ceb9d2d4e6a90fc5
> Thanks a lot for your contribution!
Committed both to 2024.05.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-20 20:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27 10:34 [Buildroot] [PATCH] dhrystone: add patch with forward declarations for functions Steffen Persvold
2024-07-15 9:28 ` Thomas Petazzoni via buildroot
2024-08-20 20:05 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox