Compiler error bug in PellesC version 8.0 RC2

Started by guser, April 14, 2014, 12:23:42 AM

Previous topic - Next topic

guser

Hi,

Thank you so much for your updated work on your compiler.

I'd like to report a bug in the new C compiler version 8.0 RC2.
Same code compiled fine with Pelles C version 7.0.x
I'm getting these errors:
Quoteerror #3120: [asm] Symbol '_SzAlloc@8' is undefined.
error #3120: [asm] Symbol '_SzFree@8' is undefined.

My code to let you reproduce:

main.c:

#include "Types.h"
#include "7zAlloc.h"

ISzAlloc allocImp;
ISzAlloc allocTempImp;

void doit(void)
{
  allocImp.Alloc = SzAlloc;
  allocImp.Free = SzFree;
}


Extract of Types.h:
typedef struct
{
  void *(*Alloc)(void *p, size_t size);
  void (*Free)(void *p, void *address); /* address can be 0 */
} ISzAlloc;

#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
#define IAlloc_Free(p, a) (p)->Free((p), a)


7zAlloc.h:
#ifndef _7Z_ALLOC_H
#define _7Z_ALLOC_H

#include <stdlib.h>

void *SzAlloc(void *p, size_t size);
void SzFree(void *p, void *address);

void *SzAllocTemp(void *p, size_t size);
void SzFreeTemp(void *p, void *address);

#endif


Everything is correctly defined. But I'm getting undefined symbol when compiling. Note that the code completion feature correctly detects SzAlloc and SzFree.

Hope this will help you to find the solution for this bug.

Note: source files come from the 7z LZMA SDK in public domain at http://7-zip.org

Thanks!

Guser



TimoVJL

#1
Optimizer problem speed/size.
Missing part for testing:/* 7zAlloc.c -- Allocation functions
2010-10-29 : Igor Pavlov : Public domain */

#include "7zAlloc.h"

void *SzAlloc(void *p, size_t size)
{
  p = p;
  if (size == 0)
    return 0;
  return malloc(size);
}

void SzFree(void *p, void *address)
{
  p = p;
  free(address);
}

void *SzAllocTemp(void *p, size_t size)
{
  p = p;
  if (size == 0)
    return 0;
  return malloc(size);
}

void SzFreeTemp(void *p, void *address)
{
  p = p;
free(address);
}

EDIT: example project.
May the source be with you

aMarCruz


Pelle

/Pelle

guser

Hi,

Sure I understand. I wrote a project with all options.
Then zipped project with IDE's "zip project" feature.
I attached the zip archive.

Try to compile main1.c: here is the result:

Building main1.obj.
\pellescbug\main1.c(12): error #3120: [asm] Symbol '_SzAlloc@8' is undefined.
\pellescbug\main1.c(12): error #3120: [asm] Symbol '_SzFree@8' is undefined.
*** Error code: 1 ***

Thanks!

Guser