summaryrefslogtreecommitdiffstats
path: root/fixincludes
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2020-09-11 11:58:59 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2020-09-17 09:36:42 +0000
commit21138a4e9ba536b46b28c2d6eb2c114ffbadc42a (patch)
treed43ff925c1fc742e455d00245b85f094b25c9588 /fixincludes
parentC-SKY: Add -msim option (diff)
downloadgcc-21138a4e9ba536b46b28c2d6eb2c114ffbadc42a.tar.gz
gcc-21138a4e9ba536b46b28c2d6eb2c114ffbadc42a.tar.bz2
gcc-21138a4e9ba536b46b28c2d6eb2c114ffbadc42a.tar.xz
fixincludes/fixfixes.c: Fix 'set but not used' warning.
pz_tmp_base and pz_tmp_dot are always set, but used only when _PC_NAME_MAX is defined. This patch moves their declaration and definition undef #ifdef _PC_NAME_MAX to avoid this warning. 2020-09-11 Torbjörn SVENSSON <torbjorn.svensson@st.com> Christophe Lyon <christophe.lyon@linaro.org> fixincludes/ * fixfixes.c (pz_tmp_base, pz_tmp_dot): Define only with _PC_NAME_MAX.
Diffstat (limited to 'fixincludes')
-rw-r--r--fixincludes/fixfixes.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fixincludes/fixfixes.c b/fixincludes/fixfixes.c
index 034e15d9985..5b23a8b640d 100644
--- a/fixincludes/fixfixes.c
+++ b/fixincludes/fixfixes.c
@@ -738,8 +738,10 @@ main( int argc, char** argv )
738{ 738{
739 tFixDesc* pFix; 739 tFixDesc* pFix;
740 char* pz_tmptmp; 740 char* pz_tmptmp;
741#ifdef _PC_NAME_MAX
741 char* pz_tmp_base; 742 char* pz_tmp_base;
742 char* pz_tmp_dot; 743 char* pz_tmp_dot;
744#endif
743 745
744 if (argc != 5) 746 if (argc != 5)
745 { 747 {
@@ -772,12 +774,12 @@ main( int argc, char** argv )
772 pz_tmptmp = XNEWVEC (char, strlen (argv[4]) + 5); 774 pz_tmptmp = XNEWVEC (char, strlen (argv[4]) + 5);
773 strcpy( pz_tmptmp, argv[4] ); 775 strcpy( pz_tmptmp, argv[4] );
774 776
777#ifdef _PC_NAME_MAX
775 /* Don't lose because "12345678" and "12345678X" map to the same 778 /* Don't lose because "12345678" and "12345678X" map to the same
776 file under DOS restricted 8+3 file namespace. Note that DOS 779 file under DOS restricted 8+3 file namespace. Note that DOS
777 doesn't allow more than one dot in the trunk of a file name. */ 780 doesn't allow more than one dot in the trunk of a file name. */
778 pz_tmp_base = basename( pz_tmptmp ); 781 pz_tmp_base = basename( pz_tmptmp );
779 pz_tmp_dot = strchr( pz_tmp_base, '.' ); 782 pz_tmp_dot = strchr( pz_tmp_base, '.' );
780#ifdef _PC_NAME_MAX
781 if (pathconf( pz_tmptmp, _PC_NAME_MAX ) <= 12 /* is this DOS or Windows9X? */ 783 if (pathconf( pz_tmptmp, _PC_NAME_MAX ) <= 12 /* is this DOS or Windows9X? */
782 && pz_tmp_dot != (char*)NULL) 784 && pz_tmp_dot != (char*)NULL)
783 strcpy (pz_tmp_dot+1, "X"); /* nuke the original extension */ 785 strcpy (pz_tmp_dot+1, "X"); /* nuke the original extension */