pueden? Condition is always false in function MOSTRAR...

Post Reply
User avatar
goosfancito
Posts: 1955
Joined: Fri Oct 07, 2005 7:08 pm

pueden? Condition is always false in function MOSTRAR...

Post by goosfancito »

Error al compilar: podrían explicarme?

Warning source\pipeclte.c 26: Condition is always false in function MOSTRAR
Warning source\pipeclte.c 27: Unreachable code in function MOSTRAR


En este código:

Code: Select all | Expand

#include "winten.h"
#include "windows.h"
#include "clipapi.h"

#ifdef __H__
   #define MAX_LEN 50                // esta es la linea 26
#else
   #define MAX_LEN 100
#endif

CLIPPER MOSTRAR()
{
   if  ( MAX_LEN == 50 )
      _retc("_har");
   else
      _retc( "cli" );

   }


Gracias
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
Antonio Linares
Site Admin
Posts: 42454
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 20 times
Been thanked: 58 times
Contact:

Post by Antonio Linares »

Gustavo,

MAX_LEN es una constante por lo que el compilador sabe a priori si los valores son iguales ó distintos y por eso el warning. Luego una parte del if no se ejecutará nunca y de ahí el otro warning.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply