bugOpenEXR - Bugs: bug #33642, build fails - constness

 
 

bug #33642: build fails - constness

Submitted by:  None
Submitted on:  Sat 25 Jun 2011 01:14:44 PM UTC  
 
Category:  build/install Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 25 Jun 2011 01:14:44 PM UTC, original submission:  

building openexr 1. on Solaris 11e with Sun Studio 12.1 fails with
...
"ImfChannelListAttribute.cpp", line 122: Error: Could not find a match for::checkIsNullTerminated<::N>(char[256], const char[13]) needed in Imf::TypedAttribute<Imf::ChannelList>::readValueFrom(Imf::IStream&, int, int).
1 Error(s) detected.

This is because the Sun Studio compiler does distinguish const and non-const values.

Patch below:

--- IlmImf/ImfChannelListAttribute.cpp.orig     2011-06-25 12:59:11.543823287 +0000
+++ IlmImf/ImfChannelListAttribute.cpp  2011-06-25 13:01:08.681707573 +0000
@@ -48,7 +48,7 @@
 namespace {

 template <size_t N>
-void checkIsNullTerminated (const char (&str)[N], const char *what)
+void checkIsNullTerminated (char (&str)[N], const char *what)
 {
     for (int i = 0; i < N; ++i) {
         if (str[i] == '\0')
--- IlmImf/ImfHeader.cpp.orig   2011-06-25 13:08:25.226984026 +0000
+++ IlmImf/ImfHeader.cpp        2011-06-25 13:08:54.305742875 +0000
@@ -147,7 +147,7 @@
 }

 template <size_t N>
-void checkIsNullTerminated (const char (&str)[N], const char *what)
+void checkIsNullTerminated (char (&str)[N], const char *what)
 {
        for (int i = 0; i < N; ++i) {
                if (str[i] == '\0')

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

 

 

No changes have been made to this item

Back to the top


Powered by Savane 3.5