-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
edk2-libc: Support for compiling Python UEFI interpreter with VS2022
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4811 While trying to compile Python UEFI 3.6.8 with VS2022, got several compiler warnings from other components within the edk2-libc project. These warnings were leading to compilation failure as they were treated as errors. All these issues have been fixed through this commit. Besides this, updated the year in copy right of these file. Summary of the issues is given below for reference: 1.AppPkg\Applications\Enquire\Enquire.c Warning C4459: Declaration of 'bugs' hides global declaration. Warning C4456: Multiple declarations of 'char_max' hide previous local declarations. Warning C4456: Declaration of 'char_min' hides previous local declaration. 2.AppPkg\Applications\OrderedCollectionTest\OrderedCollectionTest.c Warning C4476: Unknown type field character '$' in format specifier. Warning C4474: Too many arguments passed for format string. 3.StdLib\BsdSocketLib\getnetbyht.c Warning C4459: Declaration of 'net' hides global declaration. 4.StdLib\EfiSocketLib\Socket.c Warning C4459: Multiple declarations of 'errno' hide global declaration. 5.AppPkg\Applications\Sockets\DataSource\DataSource.c Warning C4459: Declaration of 'BytesSent' hides global declaration. 6.AppPkg\Applications\Sockets\OobRx\OobRx.c Warning C4475: Length modifier 'L' cannot be used with type field character 'd' in format specifier. 7.AppPkg\Applications\Sockets\RawIp4Rx\RawIp4Rx.c Warning C4475: Length modifier 'L' cannot be used with type field character 'd' in format specifier. 8.StdLib\BsdSocketLib\ns_print.c Warning C4456: Multiple declarations of 't' hide previous local declarations. Warning C4457: Declaration of 'type' hides function parameter. Cc: Rebecca Cran <[email protected]> Cc: Michael D Kinney <[email protected]> Cc: Jayaprakash N <[email protected]> Signed-off-by: Jayaprakash N <[email protected]> Reviewed-by: Michael D Kinney <[email protected]>
- Loading branch information
1 parent
caea801
commit fefde4a
Showing
8 changed files
with
117 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
Steven Pemberton, CWI, Amsterdam; "[email protected]" | ||
Used with permission. | ||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR> | ||
Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.<BR> | ||
This program and the accompanying materials | ||
are licensed and made available under the terms and conditions of the BSD License | ||
which accompanies this distribution. The full text of the license may be found at | ||
|
@@ -918,15 +918,15 @@ memeq( | |
} | ||
|
||
Void | ||
farewell(int bugs) | ||
farewell(int bugs_local) | ||
{ | ||
if (bugs == 0) exit(0); | ||
if (bugs_local == 0) exit(0); | ||
printf("\n%sFor hints on dealing with the ", co); | ||
if (bugs == 1) printf("problem"); | ||
else printf("%d problems", bugs); | ||
if (bugs_local == 1) printf("problem"); | ||
else printf("%d problems", bugs_local); | ||
printf(" above\n see the section 'TROUBLESHOOTING' in the file "); | ||
printf("%s%s\n", FILENAME, oc); | ||
exit(bugs); | ||
exit(bugs_local); | ||
} | ||
|
||
/* The program has received a signal where it wasn't expecting one */ | ||
|
@@ -1927,51 +1927,51 @@ int cprop( void ) | |
|
||
if (c_signed) { | ||
#ifndef NO_UC | ||
/* Syntax error? Define NO_UC */ Volatile unsigned char c1, char_max; | ||
c1=0; char_max=0; | ||
/* Syntax error? Define NO_UC */ Volatile unsigned char c1, char_max_local; | ||
c1=0; char_max_local=0; | ||
c1++; | ||
if (setjmp(lab)==0) { /* Yields char_max */ | ||
while (c1>char_max) { | ||
char_max=c1; | ||
if (setjmp(lab)==0) { /* Yields char_max_local */ | ||
while (c1>char_max_local) { | ||
char_max_local=c1; | ||
c1++; | ||
} | ||
} | ||
Unexpected(4); | ||
if (sizeof(char) == sizeof(int)) { | ||
u_define(D_UCHAR_MAX, "", "UCHAR", "_MAX", | ||
(ulong) char_max, | ||
(ulong) char_max_local, | ||
(ulong) UCHAR_MAX, ""); | ||
} else { | ||
i_define(D_UCHAR_MAX, "", "UCHAR", "_MAX", | ||
(long) char_max, 0L, | ||
(long) char_max_local, 0L, | ||
(long) UCHAR_MAX, ""); | ||
} | ||
#endif | ||
} else { | ||
#ifndef NO_SC | ||
/* Syntax error? Define NO_SC */ Volatile signed char c1, char_max, char_min; | ||
c1=0; char_max=0; | ||
/* Syntax error? Define NO_SC */ Volatile signed char c1, char_max_local, char_min_local; | ||
c1=0; char_max_local=0; | ||
c1++; | ||
if (setjmp(lab)==0) { /* Yields char_max */ | ||
while (c1>char_max) { | ||
char_max=c1; | ||
if (setjmp(lab)==0) { /* Yields char_max_local */ | ||
while (c1>char_max_local) { | ||
char_max_local=c1; | ||
c1++; | ||
} | ||
} | ||
c1=0; char_min=0; | ||
c1=0; char_min_local=0; | ||
c1--; | ||
if (setjmp(lab)==0) { /* Yields char_min */ | ||
while (c1<char_min) { | ||
char_min=c1; | ||
if (setjmp(lab)==0) { /* Yields char_min_local */ | ||
while (c1<char_min_local) { | ||
char_min_local=c1; | ||
c1--; | ||
} | ||
} | ||
Unexpected(5); | ||
i_define(D_SCHAR_MIN, "", "SCHAR", "_MIN", | ||
(long) char_min, (long) maxint, | ||
(long) char_min_local, (long) maxint, | ||
(long) SCHAR_MIN, ""); | ||
i_define(D_SCHAR_MAX, "", "SCHAR", "_MAX", | ||
(long) char_max, 0L, | ||
(long) char_max_local, 0L, | ||
(long) SCHAR_MAX, ""); | ||
#endif /* NO_SC */ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.