Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi,

I'm getting build errors in crashrep and extensions modules (whith enabled --enable-werror option).
With these patches the warnings/errors are fixed.

Ciao
David
-C
--with-system-boost
--with-system-odbc
--enable-ext-mysql-connector
--with-system-mysql
--enable-ext-barcode
--enable-ext-diagram
--enable-ext-google-docs
--enable-ext-hunart
--enable-ext-nlpsolver
--enable-ext-ct2n
--enable-ext-numbertext
--enable-ext-oooblogger
--enable-ext-pdfimport
--enable-ext-presenter-console
--enable-ext-presenter-minimizer
--enable-ext-report-builder
--enable-ext-scripting-beanshell
--enable-ext-scripting-javascript
--enable-ext-typo
--enable-ext-validator
--enable-ext-watch-window
--enable-ext-wiki-publisher
--enable-dbus
--enable-graphite
--enable-werror
--enable-dependency-tracking
--enable-online-update
--with-num-cpus=6
--with-max-jobs=6
--disable-mozilla
--without-system-mozilla
--enable-ccache
--enable-crashdump
From d1ee9766eb5fe314bf69675a3774e566e0b7068f Mon Sep 17 00:00:00 2001
From: David Ostrovsky <David.Ostrovsky@gmx.de>
Date: Sat, 21 Apr 2012 14:27:43 +0200
Subject: [PATCH] WaE: crashrep warnings fixed

---
 crashrep/source/unx/main.cxx |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/crashrep/source/unx/main.cxx b/crashrep/source/unx/main.cxx
index f9a6320..d4c17bd 100644
--- a/crashrep/source/unx/main.cxx
+++ b/crashrep/source/unx/main.cxx
@@ -592,7 +592,11 @@ static void setup_program_dir( const char* progname )
 
         g_strProgramDir = aDir.substr( 0, pos + 1 );
         aDir.erase( pos );
-        chdir( aDir.c_str() );
+        int ret = chdir( aDir.c_str() );
+        if (!ret)
+        {
+            return;
+        }
     }
 }
 
@@ -1051,7 +1055,11 @@ static bool get_accessibility_state()
 
 int main( int argc, char** argv )
 {
-    freopen( "/dev/null", "w", stderr );
+    FILE *fin = freopen( "/dev/null", "w", stderr );
+    if (!fin) 
+    {
+        return -1;
+    }
 
     setup_program_dir( argv[0] );
 
-- 
1.7.5.4

From 9e59ac6235e1dfe270bdf0116820214d3b354de5 Mon Sep 17 00:00:00 2001
From: David Ostrovsky <David.Ostrovsky@gmx.de>
Date: Sat, 21 Apr 2012 14:29:14 +0200
Subject: [PATCH] WaE: extensions warnings fixed

---
 extensions/source/nsplugin/source/npshell.cxx |    6 ++++-
 extensions/source/scanner/sane.cxx            |   27 ++++++++++++++++++++++--
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/extensions/source/nsplugin/source/npshell.cxx 
b/extensions/source/nsplugin/source/npshell.cxx
index 81ce8fb..f6b4ea4 100644
--- a/extensions/source/nsplugin/source/npshell.cxx
+++ b/extensions/source/nsplugin/source/npshell.cxx
@@ -772,7 +772,11 @@ NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname)
 
                     break;
             }
-            write(fdDst, buffer, ret);
+            ssize_t written_bytes = write(fdDst, buffer, ret);
+            if (written_bytes == -1)
+            {
+                return;
+            }
         }
         close(fdSrc);
         close(fdDst);
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index aaefbf4..ca2cec18 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -524,11 +524,24 @@ static inline sal_uInt8 _ReadValue( FILE* fp, int depth )
         // e.g. UMAX Astra 1200S delivers 16 bit but in BIGENDIAN
         // against SANE documentation (xscanimage gets the same result
         // as we do
-        fread( &nWord, 1, 2, fp );
+        size_t items_read = fread( &nWord, 1, 2, fp );
+
+        // fread() does not distinguish between end-of-file and error, and callers
+        //   must use feof(3) and ferror(3) to determine which occurred.
+        if (items_read == 0)
+        {
+             // nothing todo?
+             // WaE is happy!
+        }
         return (sal_uInt8)( nWord / 256 );
     }
     sal_uInt8 nByte;
-    fread( &nByte, 1, 1, fp );
+    size_t items_read = fread( &nByte, 1, 1, fp );
+    if (items_read == 0)
+    {
+         // nothing todo?
+         // WaE is happy!
+    }
     return nByte;
 }
 
@@ -814,7 +827,15 @@ sal_Bool Sane::Start( BitmapTransporter& rBitmap )
                     ( eType == FrameStyle_Gray && aParams.depth == 8 )
                     )
                 {
-                    fread( pBuffer, 1, aParams.bytes_per_line, pFrame );
+                    size_t items_read = fread( pBuffer, 1, aParams.bytes_per_line, pFrame );
+                    
+                    // fread() does not distinguish between end-of-file and error, and callers
+                    //   must use feof(3) and ferror(3) to determine which occurred.
+                    if (items_read == 0)
+                    {
+                        // nothing todo?
+                        // WaE is happy!
+                    }
                     aConverter.Write( pBuffer, aParams.bytes_per_line );
                 }
                 else if( eType == FrameStyle_Gray )
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.