openal-soft: [PATCH] killed GCC 4.3 result unused warning

View: New views
2 Messages — Rating Filter:   Alert me  

openal-soft: [PATCH] killed GCC 4.3 result unused warning

by Alam Arias :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

while compiling openal-soft GIT with GCC 4.3 with WERROR on on commit 1f4c , a warning/error come up

Alc/wavec.c: In function ‘WaveProc’:
Alc/wave.c:92: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result

the attached patch should fix this unused result warning
---
 Alc/wave.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


[3897258a0b0eb0b33cdf5e2e82402ba3c8185942.diff]

diff --git a/Alc/wave.c b/Alc/wave.c
index 747155b..cba9fb1 100644
--- a/Alc/wave.c
+++ b/Alc/wave.c
@@ -50,6 +50,7 @@ static ALuint WaveProc(ALvoid *ptr)
     ALuint frameSize;
     ALuint now, last;
     size_t WriteCnt;
+    size_t fs;
     ALuint avail;
     union {
         short s;
@@ -89,7 +90,7 @@ static ALuint WaveProc(ALvoid *ptr)
                     fputc(bytes[i^1], data->f);
             }
             else
-                fwrite(data->buffer, frameSize, WriteCnt, data->f);
+                fs = fwrite(data->buffer, frameSize, WriteCnt, data->f);
             if(ferror(data->f))
             {
                 AL_PRINT("Error writing to file\n");


_______________________________________________
Openal-devel mailing list
Openal-devel@...
http://opensource.creative.com/mailman/listinfo/openal-devel

Re: openal-soft: [PATCH] killed GCC 4.3 result unused warning

by Chris Robinson-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Monday 26 January 2009 1:26:00 am Alam Arias wrote:
> while compiling openal-soft GIT with GCC 4.3 with WERROR on on commit 1f4c
> , a warning/error come up
>
> Alc/wavec.c: In function ‘WaveProc’:
> Alc/wave.c:92: error: ignoring return value of ‘fwrite’, declared with
> attribute warn_unused_result
>
> the attached patch should fix this unused result warning

Thanks for the patch. Fixed. :)

_______________________________________________
Openal-devel mailing list
Openal-devel@...
http://opensource.creative.com/mailman/listinfo/openal-devel