HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- String Literals in r/o memory
Operating System - HP-UX
        1839866
        Members
    
    
        2745
        Online
    
    
        110156
        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
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
12-17-2002 07:03 AM
12-17-2002 07:03 AM
			
				
					
						
							String Literals in r/o memory
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						I have some code that results in
Warning 829: Implicit conversion of string literal to 'char
I understand what is causing this
and how to 'fix' it (changing the
char * to const char *). I also
know I can just ignore it by using -W829.
I've also tried using the compiler switch +ESnolit,
which says it will place
string literals into standard
memory instead of r/o memory
which is the default (+ESlit).
This doesn't seem to work, using +ESnolit still results
in the 829. Am I interpreting
this switch incorrectly, shouldn't it resolve this
problem?
		
		
	
	
	
Warning 829: Implicit conversion of string literal to 'char
I understand what is causing this
and how to 'fix' it (changing the
char * to const char *). I also
know I can just ignore it by using -W829.
I've also tried using the compiler switch +ESnolit,
which says it will place
string literals into standard
memory instead of r/o memory
which is the default (+ESlit).
This doesn't seem to work, using +ESnolit still results
in the 829. Am I interpreting
this switch incorrectly, shouldn't it resolve this
problem?
		1 REPLY 1
	
	            
            
		
		
			
            
                - Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2002 07:13 AM
12-17-2002 07:13 AM
			
				
					
						
							Re: String Literals in r/o memory
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						That compiler flag has little to do with this. It's really saying that you might plan to change the contents of that string. You really should use the (const char *)
casting to tell the compiler that you don't intend to change this string; that makes it possible for the optimizer to replace multiple instances of the string literal with just one instance.
In your specific case, the compiler is asking you to explicitly indicate your intentions for this string.
					
				
			
			
				
		
		
	
	
	
casting to tell the compiler that you don't intend to change this string; that makes it possible for the optimizer to replace multiple instances of the string literal with just one instance.
In your specific case, the compiler is asking you to explicitly indicate your intentions for this string.
	If it ain't broke, I can fix that.
			
			
				
			
			
			
			
			
			
		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
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP
