SourceForge has been redesigned. Learn more.
Close

#57 FTBFS with -Werror

open
nobody
core_devel (11)
5
2012-01-23
2012-01-23
kwizart
No

This was reported on various site over the net but not on this tracker.
It is not possible to build with -Werror since this warning occurs:

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -Wall -Werror -DCONFIG_DEBUG_LEVEL=0 -c omx_base_component.c -fPIC -DPIC -o .libs/libomxbase_la-omx_base_component.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -Wall -Werror -DCONFIG_DEBUG_LEVEL=0 -c omx_base_video_port.c -fPIC -DPIC -o .libs/libomxbase_la-omx_base_video_port.o
/bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -Wall -Werror -DCONFIG_DEBUG_LEVEL=0 -c -o libomxbase_la-omx_base_image_port.lo `test -f 'omx_base_image_port.c' || echo './'`omx_base_image_port.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -Wall -Werror -DCONFIG_DEBUG_LEVEL=0 -c omx_base_image_port.c -fPIC -DPIC -o .libs/libomxbase_la-omx_base_image_port.o
omx_base_component.c: In function 'omx_base_component_GetParameter':
omx_base_component.c:991:3: error: case value '2130706435' not in enumerated type 'OMX_INDEXTYPE' [-Werror=switch]
omx_base_component.c:918:3: error: case value '2130706436' not in enumerated type 'OMX_INDEXTYPE' [-Werror=switch]
cc1: all warnings being treated as errors
make[3]: *** [libomxbase_la-omx_base_component.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/builddir/build/BUILD/libomxil-bellagio-0.9.3/src/base'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/builddir/build/BUILD/libomxil-bellagio-0.9.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/builddir/build/BUILD/libomxil-bellagio-0.9.3'
make: *** [all] Error 2

Discussion

  • Niels de Vos

    Niels de Vos - 2012-04-22

    I can confirm that this issue is not fixed yet in todays git. (There have not been any changes since this issue was filed.)

     
  • Niels de Vos

    Niels de Vos - 2012-04-22

    Hmm, I can not attach any proposed patches, will just have to copy/paste them in here :-/

    From 0c76792f4b1dbbff4e8cc044054ea5371de35017 Mon Sep 17 00:00:00 2001
    From: Niels de Vos <devos@fedoraproject.org>
    Date: Sun, 22 Apr 2012 14:44:34 +0200
    Subject: [PATCH 1/2] Fix compile warning for
    OMX_INDEXTYPE/OMX_INDEXVENDORTYPE in one switch

    Use the default: label in the switch for OMX_INDEXTYPE to add checks for
    values in OMX_INDEXVENDORTYPE.

    Fixes error:
    omx_base_component.c: In function 'omx_base_component_GetParameter':
    omx_base_component.c:991:3: error: case value '2130706435' not in enumerated type 'OMX_INDEXTYPE' [-Werror=switch]
    omx_base_component.c:918:3: error: case value '2130706436' not in enumerated type 'OMX_INDEXTYPE' [-Werror=switch]

    Issue: http://sourceforge.net/tracker/?func=detail&aid=3477869&group_id=160680&atid=816817
    Signed-off-by: Niels de Vos <devos@fedoraproject.org>
    ---
    src/base/omx_base_component.c | 54 ++++++++++++++++++++++-------------------
    1 files changed, 29 insertions(+), 25 deletions(-)

    diff --git a/src/base/omx_base_component.c b/src/base/omx_base_component.c
    index 4156c37..558c1f0 100644
    --- a/src/base/omx_base_component.c
    +++ b/src/base/omx_base_component.c
    @@ -915,14 +915,6 @@ OSCL_EXPORT_REF OSCL_EXPORT_REF OMX_ERRORTYPE omx_base_component_GetParameter(
    return OMX_ErrorBadParameter;
    }
    switch(nParamIndex) {
    - case OMX_IndexParameterThreadsID:
    - if ((err = checkHeader(ComponentParameterStructure, sizeof(OMX_PARAM_BELLAGIOTHREADS_ID))) != OMX_ErrorNone) {
    - break;
    - }
    - threadID = (OMX_PARAM_BELLAGIOTHREADS_ID *)ComponentParameterStructure;
    - threadID->nThreadBufferMngtID = omx_base_component_Private->bellagioThreads->nThreadBufferMngtID;
    - threadID->nThreadMessageID = omx_base_component_Private->bellagioThreads->nThreadMessageID;
    - break;
    case OMX_IndexParamAudioInit:
    case OMX_IndexParamVideoInit:
    case OMX_IndexParamImageInit:
    @@ -988,28 +980,40 @@ OSCL_EXPORT_REF OSCL_EXPORT_REF OMX_ERRORTYPE omx_base_component_GetParameter(
    }
    }
    break;
    - case OMX_IndexVendorCompPropTunnelFlags:
    - pPropTunnelSetup = (OMX_VENDOR_PROP_TUNNELSETUPTYPE*)ComponentParameterStructure;
    + default:
    + /* additional switch statement for extended OMX_INDEXTYPE */
    + switch((OMX_INDEXVENDORTYPE) nParamIndex) {
    + case OMX_IndexParameterThreadsID:
    + if ((err = checkHeader(ComponentParameterStructure, sizeof(OMX_PARAM_BELLAGIOTHREADS_ID))) != OMX_ErrorNone) {
    + break;
    + }
    + threadID = (OMX_PARAM_BELLAGIOTHREADS_ID *)ComponentParameterStructure;
    + threadID->nThreadBufferMngtID = omx_base_component_Private->bellagioThreads->nThreadBufferMngtID;
    + threadID->nThreadMessageID = omx_base_component_Private->bellagioThreads->nThreadMessageID;
    + break;
    + case OMX_IndexVendorCompPropTunnelFlags:
    + pPropTunnelSetup = (OMX_VENDOR_PROP_TUNNELSETUPTYPE*)ComponentParameterStructure;

    - if (pPropTunnelSetup->nPortIndex >= (omx_base_component_Private->sPortTypesParam[OMX_PortDomainAudio].nPorts +
    - omx_base_component_Private->sPortTypesParam[OMX_PortDomainVideo].nPorts +
    - omx_base_component_Private->sPortTypesParam[OMX_PortDomainImage].nPorts +
    - omx_base_component_Private->sPortTypesParam[OMX_PortDomainOther].nPorts)) {
    + if (pPropTunnelSetup->nPortIndex >= (omx_base_component_Private->sPortTypesParam[OMX_PortDomainAudio].nPorts +
    + omx_base_component_Private->sPortTypesParam[OMX_PortDomainVideo].nPorts +
    + omx_base_component_Private->sPortTypesParam[OMX_PortDomainImage].nPorts +
    + omx_base_component_Private->sPortTypesParam[OMX_PortDomainOther].nPorts)) {

    - DEBUG(DEB_LEV_ERR,"In %s OMX_IndexVendorCompPropTunnelFlags nPortIndex=%d Line=%d \n",
    - __func__,(int)pPropTunnelSetup->nPortIndex,__LINE__);
    + DEBUG(DEB_LEV_ERR,"In %s OMX_IndexVendorCompPropTunnelFlags nPortIndex=%d Line=%d \n",
    + __func__,(int)pPropTunnelSetup->nPortIndex,__LINE__);

    - return OMX_ErrorBadPortIndex;
    - }
    + return OMX_ErrorBadPortIndex;
    + }

    - pPort = omx_base_component_Private->ports[pPropTunnelSetup->nPortIndex];
    + pPort = omx_base_component_Private->ports[pPropTunnelSetup->nPortIndex];

    - pPropTunnelSetup->nTunnelSetup.nTunnelFlags = pPort->nTunnelFlags;
    - pPropTunnelSetup->nTunnelSetup.eSupplier = pPort->eBufferSupplier;
    - break;
    - default:
    - err = OMX_ErrorUnsupportedIndex;
    - break;
    + pPropTunnelSetup->nTunnelSetup.nTunnelFlags = pPort->nTunnelFlags;
    + pPropTunnelSetup->nTunnelSetup.eSupplier = pPort->eBufferSupplier;
    + break;
    + default:
    + err = OMX_ErrorUnsupportedIndex;
    + break;
    + }
    }
    DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s for component %p\n", __func__, hComponent);
    return err;
    --
    1.7.7.5

    From 22e914137153ce1f319cd55dc09984cab57a20c4 Mon Sep 17 00:00:00 2001
    From: Niels de Vos <devos@fedoraproject.org>
    Date: Sun, 22 Apr 2012 14:51:48 +0200
    Subject: [PATCH 2/2] Remove unused 'err' in buildComponentsList()
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit

    The err variable is only set fwrite(), but never checked or used otherwise.
    There is no need to keep this variable.

    Fixes the following build error:
    omxregister.c: In function ‘buildComponentsList’:
    omxregister.c:175:7: error: variable ‘err’ set but not used [-Werror=unused-but-set-variable]

    Issue: http://sourceforge.net/tracker/?func=detail&aid=3477869&group_id=160680&atid=816817
    Signed-off-by: Niels de Vos <devos@fedoraproject.org>
    ---
    src/omxregister.c | 7 +++----
    1 files changed, 3 insertions(+), 4 deletions(-)

    diff --git a/src/omxregister.c b/src/omxregister.c
    index b593f3e..9cdccde 100644
    --- a/src/omxregister.c
    +++ b/src/omxregister.c
    @@ -172,7 +172,6 @@ static int buildComponentsList(FILE* omxregistryfp, char *componentspath, int ve
    int index;
    char* currentpath = componentspath;
    char* actual;
    - int err;
    nameList *allNames = NULL;
    nameList *currentName = NULL;
    nameList *tempName = NULL;
    @@ -247,8 +246,8 @@ static int buildComponentsList(FILE* omxregistryfp, char *componentspath, int ve
    stComponents[i]->multiResourceLevel = NULL;
    }
    fptr(stComponents);
    - err = fwrite(lib_absolute_path, 1, strlen(lib_absolute_path), omxregistryfp);
    - err = fwrite("\n", 1, 1, omxregistryfp);
    + fwrite(lib_absolute_path, 1, strlen(lib_absolute_path), omxregistryfp);
    + fwrite("\n", 1, 1, omxregistryfp);

    for (i = 0; i<num_of_comp; i++) {
    @@ -323,7 +322,7 @@ static int buildComponentsList(FILE* omxregistryfp, char *componentspath, int ve
    }
    qualityString[0] = '\0';
    strcat(buffer, "\n");
    - err = fwrite(buffer, 1, strlen(buffer), omxregistryfp);
    + fwrite(buffer, 1, strlen(buffer), omxregistryfp);
    ncomponents++;
    }
    for (i = 0; i < num_of_comp; i++) {
    --
    1.7.7.5

     

Log in to post a comment.