Kompiler Warnung

norline

Mitglied
Hi,
Bei kompilieren mit gcc bekomme ich immer diese Warnung:
struct xy" declared inside parameter list
bitte helft mir
 
Hallo Peter ,
Das code ist zu groß aber ich kopiere ein Teil von der header-datei,wo der struct definiert ist.


#ifdef AMS_TX_MIN
typedef struct Msg_Tx_Type
{
byte Status;
byte Priority;
word Tgt_Adr;
byte FBlock_ID;
byte Inst_ID;
word Func_ID;
byte Operation;
word Length;
byte Data[MAX_MSG_TX_DATA];
#if (MAX_TX_HANDLE > 0)
byte TxHandle[MAX_TX_HANDLE];
#endif
#ifdef CTRL_FILTER_ID
byte Filter_ID;
#endif
#ifdef AMS_TX_ADD8
byte *PtrDataExt;
#endif
} TMsgTx, *pTMsgTx;

typedef struct Msg_TxOpt_Type
{
byte Priority;
#if (MAX_TX_HANDLE > 0)
byte TxHandle[MAX_TX_HANDLE];
#endif
#ifdef CTRL_FILTER_ID
byte Filter_ID;
#endif
} TMsgTxOpt, *pTMsgTxOpt;

#endif // AMS_TX_MIN


#ifdef AMS_RX_MIN
typedef struct Msg_Rx_Type
{
byte Status;
byte BlckCnt;
byte UsageCnt;
word Src_Adr;
byte FBlock_ID;
byte Inst_ID;
word Func_ID;
byte Operation;
word Length;
byte Data[MAX_MSG_RX_DATA];
#if (MAX_EXT_DATA > 0)
byte ExtData[MAX_EXT_DATA];
#endif
#ifdef CTRL_FILTER_ID
byte Filter_ID;
#endif
byte *DPtrIn;
byte Rcv_Type;

#ifdef AMS_RX_ADD5
byte* PtrData; // pointer at data field
word SizeBuffer; // size of data field
struct Msg_Rx_ExtBuf_Type* PtrNext; // pointer at next field
struct Msg_Rx_ExtBuf_Type* PtrCurBufExt; // pointer at current buffer extension (Last extension)
word CurSizeMsgBuf; // current size of buffer
#endif

} TMsgRx, *pTMsgRx;

typedef struct Msg_RxOpt_Type
{
#if (MAX_EXT_DATA > 0)
byte ExtData[MAX_EXT_DATA];
#endif
#ifdef CTRL_FILTER_ID
byte Filter_ID;
#endif
byte Rcv_Type;

} TMsgRxOpt, *pTMsgRxOpt;

#endif // AMS_RX_MIN


#ifdef AMS_RX_ADD5
typedef struct Msg_Rx_ExtBuf_Type
{
byte* PtrData; // pointer at data field
word SizeBuffer; // size of data field
struct Msg_Rx_ExtBuf_Type* PtrNext; // pointer at next field
struct Msg_Rx_ExtBuf_Type* PtrPrev; // pointer at previous field

} TMsgRxExtBuf, *pTMsgRxExtBuf;

#endif



//-----------------------------------------------------------------//
// Type Declaration of Synchronous Channel Allocation Service //
//-----------------------------------------------------------------//

#ifndef SCS_NO_ADDR_CALC

#ifdef SP_SER
typedef struct SrcData_Type // Source Data ID in serial mode
{
byte Port;
byte Byte;
} TSrcData, *pTSrcData;
#endif

#ifdef SP_PAR
typedef struct SrcData_Type // Source Data ID in parallel mode
{
byte SF;
byte Byte;
} TSrcData, *pTSrcData;
#endif

#else

typedef struct SrcData_Type // Address Reference is calculated
{ // by application or before compilation
byte AddrRef;
} TSrcData, *pTSrcData;

#endif


//-----------------------------------------------------------------//
// Type Declaration of Async. Data Transmission Service (ADS) //
//-----------------------------------------------------------------//

#ifdef ADS_TX_MIN
typedef struct Data_Tx_Type
{
byte Status;
byte Priority;
byte Tgt_Adr_H;
byte Tgt_Adr_L;
byte Data[48];
byte Length;
#if (MAX_DATA_TX_HANDLE > 0)
byte TxHandle[MAX_DATA_TX_HANDLE];
#endif
} TDataTx, *pTDataTx;
#endif


#ifdef ADS_RX_MIN
typedef struct Data_Rx_Type
{
byte Status;
byte Tgt_Adr_H;
byte Tgt_Adr_L;
byte Src_Adr_H;
byte Src_Adr_L;
byte Data[48];
#if (MAX_DATA_EXT_DATA > 0)
byte ExtData[MAX_DATA_EXT_DATA];
#endif
} TDataRx, *pTDataRx;
#endif


#ifdef _WIN32
#pragma pack()
#endif
 
Hi,

die Deklarationen helfen nicht wirklich weiter.

Poste doch mal nur den Ausschnitt, wo die Warnung herkommt.

Peter
 
hi,
Hier ein kleines Beispiel:
Code:
#include <stdio.h>
#include <conio.h>

#define _CLIENT_MAIN

#include "adjust.h"
#include "mostdef1.h"
#include "mostns1.h"
#include "mostnetsdll.h"

BYTE DeviceMode = SLAVE;

// Send an eject to MOSTMediaPlayer on Address 0x190

void CtrlSample(void)
{
	pTCtrlTx ptx;

	ptx = CtrlGetTxPtr();

	if (ptx)
	{
		ptx->Priority = 0x00;
		ptx->MsgType = 0x00;
		ptx->Tgt_Adr_H = 0x01;
		ptx->Tgt_Adr_L = 0x90;
		ptx->Length = 6;
		ptx->Data[0] = 0x3F;	// FBlock
		ptx->Data[1] = 0x00;	// Inst
		ptx->Data[2] = 0x20;	// Func
		ptx->Data[3] = 0x00;	// Func + OpType
		ptx->Data[4] = 0x01;	// Length
		ptx->Data[5] = 0x04;

		CtrlSend(ptx);
	}

}

// Send an eject to MOSTMediaPlayer on Address 0x190

void MsgSample(void)
{
	pTMsgTx ptx;

	ptx = MsgGetTxPtr();

	if (ptx)
	{
		ptx->Priority = 0x00;
		ptx->Tgt_Adr = 0x0190;
		ptx->FBlock_ID = 0x3F;	// FBlock
		ptx->Inst_ID = 0x00;		// Inst
		ptx->Func_ID = 0x200;		// Func
		ptx->Operation = 0x0;		// OpType
		ptx->Length = 0x01;		// Length
		ptx->Data[0] = 0x04;	// Eject

		MsgSend(ptx);
	}

}

void main(int argc, char *argv[])
{
	short ret;
	int j;
	int key;

	BusType = BUS_TYPE_PCI;			// default
	InstID = 0;						// default
	UseMsgInterface = FALSE;
	strcpy(ClientName, "Client1");		// only needed by OptoLyzer4MOST Prof. (Simulation)

	if (argc > 1)
	{
		for (j = 1; j < argc; j++)
		{
			if (!strcmp(argv[j], "-d"))
			{
				if (!strcmp(argv[j+1], "ISA"))
					BusType = BUS_TYPE_ISA;

				if (!strcmp(argv[j+1], "PCI"))
					BusType = BUS_TYPE_PCI;

				if (!strcmp(argv[j+1], "SER"))
				{
					BusType = BUS_TYPE_SER;
					UseMsgInterface = TRUE;
				}
			}
			
			if (!strcmp(argv[j], "-i"))
			{
				InstID = atoi(argv[j+1]);
			}

			if (!strcmp(argv[j], "-m"))
			{
				DeviceMode = MASTER;
			}

		}
	}


	ret = OpenNetServices();

	if (ret < 0)
	{
		printf("OpenNetServices failed: %d\n", ret);
		printf("Press key to exit\n");
		getch();
		return;
	}

	MostStartUp(DeviceMode, RESET);


	do
	{
		printf("KeyCodes:\n");
		printf("        <ESC> to exit\n");
		printf("        <C> Send CtrlMsg using CMS\n");
		printf("        <M> Send CtrlMsg using AMS\n");

		key = getch();

		switch(key)
		{
		case 'c':
		case 'C':
			printf("Sending Ctrl Message (CMS) to 0x190 (Eject)\n");
			CtrlSample();
			break;
		case 'm':
		case 'M':
			printf("Sending Ctrl Message (AMS) to 0x190 (Eject)\n");
			MsgSample();
			break;
		}

	} while(key != 0x1B);	


	CloseNetServices();
}


void PrintDebug(char *str)
{
	printf(str);
	printf("\n");
}
 
Hi,

also erstmal solltest du, wenn du Code postest, diesen in einen \
Code:
 \
packen.

Ich sehe aber immer noch nicht, wo dein Problem liegt. Es wäre vielleicht hilfreich, wenn du die genaue Stelle markierst, die angemosert wird.

In der Warnung steht doch auch immer ne Zeilennummer.

Peter
 
Hi,

also erstmal solltest du, wenn du Code postest, diesen in einen [ CODE] [ /CODE] packen.

Ich sehe aber immer noch nicht, wo dein Problem liegt. Es wäre vielleicht hilfreich, wenn du die genaue Stelle markierst, die angemosert wird.

In der Warnung steht doch auch immer ne Zeilennummer.

Peter
 
Zurück