[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] TCC seems to be confused by a structure field: how should
From: |
Harry Yan |
Subject: |
[Tinycc-devel] TCC seems to be confused by a structure field: how should I fix this? |
Date: |
Thu, 22 Dec 2022 16:20:12 +0800 (CST) |
Hello,
I am trying to build the SQLite3 command-line tool with TCC.
It works well with GCC:
> $ gcc -c shell.c dirent.c
> (no complaints)
However, TCC seems to be confused by a structure field:
> $ tcc -c shell.c dirent.c
> shell.c:5359: error: field not found: d_name
Where line 5359 refers a d->name field from a dirent structure, which should be
the problem.
5355 while( pCur->iLvl>=0 ){
5356 FsdirLevel *pLvl = &pCur->aLvl[pCur->iLvl];
5357 struct dirent *pEntry = readdir(pLvl->pDir);
5358 if( pEntry ){
5359 if( pEntry->d_name[0]=='.' ){
5360 if( pEntry->d_name[1]=='.' && pEntry->d_name[2]=='\0' ) continue;
5361 if( pEntry->d_name[1]=='\0' ) continue;
5362 }
5363 sqlite3_free(pCur->zPath);
5364 pCur->zPath = sqlite3_mprintf("%s/%s", pLvl->zDir, pEntry->d_name);
5365 if( pCur->zPath==0 ) return SQLITE_NOMEM;
5366 if( fileLinkStat(pCur->zPath, &pCur->sStat) ){
5367 fsdirSetErrmsg(pCur, "cannot stat file: %s", pCur->zPath);
5368 return SQLITE_ERROR;
5369 }
5370 return SQLITE_OK;
5371 }
My TCC version is 0.9.27, which should be the latest. I am on the Windows
system.
I have attached the files in a zip so that it would be easy to test.
Thank you all for the help,
Harry
tcc-attachment-221222.zip
Description: Zip archive
- [Tinycc-devel] TCC seems to be confused by a structure field: how should I fix this?,
Harry Yan <=