HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: warning #2226-D: invalid format string convers...
Operating System - HP-UX
1827740
Members
3415
Online
109969
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 11:37 AM
10-06-2010 11:37 AM
I get the following warning when trying to compile some C code:
cc -D_USE_BIG_FDS -Ae -DHPUX -DORAIA64 -DHPUX_IA64 +DD64 -DSS_64B -IT_S
ERVER -DHPPA64 -DSLS8NATIVE -DSLU8NATIVE +DD64 -DSS_64BIT_SERVER /u01/app/oracle
/product/11.2.0/clnt/precomp/public/ -c CacheUtils.c
"CacheUtils.c", line 30: warning #2226-D: invalid format string conversion
g_cache_db_criterias[i].ac_where_clause_02,g_cache_db_cr
iterias[i].ac_from_clause);
Here are the lines of code that are causing the problem:
printf("%-5d%-20s%\n-20s%-20s\n",g_cache_db_criterias[i]
.i_criteria_id,g_cache_db_criterias[i].ac_where_clause_01,\
g_cache_db_criterias[i].ac_where_clause_02,g_cac
he_db_criterias[i].ac_from_clause);
Why am I getting this warning and how do I resolve it?
Thanks,
Curtis
cc -D_USE_BIG_FDS -Ae -DHPUX -DORAIA64 -DHPUX_IA64 +DD64 -DSS_64B -IT_S
ERVER -DHPPA64 -DSLS8NATIVE -DSLU8NATIVE +DD64 -DSS_64BIT_SERVER /u01/app/oracle
/product/11.2.0/clnt/precomp/public/ -c CacheUtils.c
"CacheUtils.c", line 30: warning #2226-D: invalid format string conversion
g_cache_db_criterias[i].ac_where_clause_02,g_cache_db_cr
iterias[i].ac_from_clause);
Here are the lines of code that are causing the problem:
printf("%-5d%-20s%\n-20s%-20s\n",g_cache_db_criterias[i]
.i_criteria_id,g_cache_db_criterias[i].ac_where_clause_01,\
g_cache_db_criterias[i].ac_where_clause_02,g_cac
he_db_criterias[i].ac_from_clause);
Why am I getting this warning and how do I resolve it?
Thanks,
Curtis
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 12:03 PM
10-06-2010 12:03 PM
Solution
> [...] "%-5d%-20s%\n-20s%-20s\n" [...]
In there, I see: "%-5d", "%-20s", "%\n-20s",
and "%-20s\n". That third one troubles me.
"HP C V7.3-009 on OpenVMS Alpha V8.3" doesn't
seem to like it much, either:
alp $ type fmt.c
#include
int main( void)
{
char *cs1 = "cs1";
char *cs2 = "cs2";
char *cs3 = "cs3";
int i1 = 1;
printf( "%-5d%-20s%\n-20s%-20s\n",
i1, cs1, cs2, cs3);
}
alp $ cc fmt.c
printf( "%-5d%-20s%\n-20s%-20s\n",
............^
%CC-W-BADCONVSPEC, In this statement, this argument to printf contains a bad conversion specification "%
" that will cause unpredictable behavior.
at line number 10 in file ALP$DKA0:[SMS.ITRC]fmt.c;1
Note that it seems to be complaining about
the "%\n".
In there, I see: "%-5d", "%-20s", "%\n-20s",
and "%-20s\n". That third one troubles me.
"HP C V7.3-009 on OpenVMS Alpha V8.3" doesn't
seem to like it much, either:
alp $ type fmt.c
#include
int main( void)
{
char *cs1 = "cs1";
char *cs2 = "cs2";
char *cs3 = "cs3";
int i1 = 1;
printf( "%-5d%-20s%\n-20s%-20s\n",
i1, cs1, cs2, cs3);
}
alp $ cc fmt.c
printf( "%-5d%-20s%\n-20s%-20s\n",
............^
%CC-W-BADCONVSPEC, In this statement, this argument to printf contains a bad conversion specification "%
" that will cause unpredictable behavior.
at line number 10 in file ALP$DKA0:[SMS.ITRC]fmt.c;1
Note that it seems to be complaining about
the "%\n".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 08:53 PM
10-06-2010 08:53 PM
Re: warning #2226-D: invalid format string conversion
>printf("%-5d%-20s%\n-20s%-20s\n"
If it isn't obvious, you probably want:
printf("%-5d%-20s\n%-20s%-20s\n"
If it isn't obvious, you probably want:
printf("%-5d%-20s\n%-20s%-20s\n"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2010 04:44 AM
10-07-2010 04:44 AM
Re: warning #2226-D: invalid format string conversion
printf("%-5d%-20s\n%-20s%-20s\n"
resolved the problem.
Thanks,
Curtis
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP