Issue Details (XML | Word | Printable)

Key: PCC-88
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Detlef Riekenberg
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

pcc is still unable to detect freetype2

Created: 22/Aug/09 09:10 PM   Updated: 04/May/14 03:04 PM
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. Text File _diff_define_max.txt (1 kB)
2. Text File _diff_extend_limits.txt (0.7 kB)
3. File ft2.c (0.1 kB)

Environment: i386-linux


 Description  « Hide
This is an update of: http://pcc.ludd.ltu.se/jira/browse/PCC-76

A configure script still failed to detect freetype2, when using pcc.
Attached is an updated testcase.

With the spaces (one to lots of) before #include, pcc bail out with:

_scrap/ft2$ pcc -I/usr/include/freetype2 ft2.c -c -o ft2_pcc.o
ft2.c, line 16: syntax error

There are 2 Problems here.
1. pcc failed to compile that code.
    (The standard might say, that the "#" is expected to be in the first column,
    but the attached code works with gcc and tcc)

2. The failure message say "line 16", while the source has only 5 lines

--
By by ... Detlef


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Detlef Riekenberg added a comment - 23/Aug/09 06:10 PM
A lot more header checks are affected by this bug.
Example from: diff -u bin_gcc/_configure.txt bin_pcc/_configure.txt

-checking for sys/mount.h... yes
-checking for sys/statfs.h... yes
-checking for sys/sysctl.h... yes
-checking for sys/user.h... yes
-checking for sys/vfs.h... yes
-checking for netinet/ip.h... yes
-checking for net/if.h... yes
-checking for net/if_arp.h... yes
+checking for sys/mount.h... no
+checking for sys/statfs.h... no
+checking for sys/sysctl.h... no
+checking for sys/user.h... no
+checking for sys/vfs.h... no
+checking for netinet/ip.h... no
+checking for net/if.h... no
+checking for net/if_arp.h... no

More locations exists, but they are striped.

--
By by ... Detlef


Detlef Riekenberg added a comment - 25/Aug/09 12:18 PM - edited
This is a cpp regression!
(How can the topic be updated?)

Freetype2 and the above headers where detected with the old cpp

I added some logging to pushfile(name) and found out, that fastscan() returned from the included file
before the "syntax error" came up.

--
By by ... Detlef



Detlef Riekenberg added a comment - 13/Jun/10 04:54 PM - edited
The example still fail to compile with pcc, but the message is different:

_scrap/ft2$ pcc -I/usr/include/freetype2 ft2.c -c -o ft2_pcc.o
/usr/include/freetype2/freetype/config/ftconfig.h:103: error: "Unsupported size of `int' type!"

freetype need defines for CHAR_BIT, UINT_MAX and ULONG_MAX, but limits.h from glibc
skip the defines and use the compiler provided limits (that is missing in libpcc_limits.h)

Extending cc/cc/cc.c to export __CHAR_BIT__, __INT_MAX__ and __LONG_MAX__
( http://pcc.ludd.ltu.se/jira/secure/attachment/10106/_diff_define_max.txt )
together with extending libpcc_limits.h to use these values to export
CHAR_BIT, UINT_MAX and ULONG_MAX
( http://pcc.ludd.ltu.se/jira/secure/attachment/10108/_diff_extend_limits.txt )
let pcc compile this example.

The attached Patches fixes these for i386, but including macdefs.h is not nice.
We get the needed defines (storage size and the MAX_* values) but the rest of macdefs.h
might have unwanted effects.
MULTITARGET was also not tested

--
By by ... Detlef

Detlef Riekenberg made changes - 13/Jun/10 04:54 PM
Field Original Value New Value
Attachment _diff_define_max.txt [ 10106 ]
Attachment _diff_extend_limits.txt [ 10107 ]
Detlef Riekenberg made changes - 13/Jun/10 05:18 PM
Attachment _diff_extend_limits.txt [ 10107 ]
Detlef Riekenberg made changes - 13/Jun/10 05:19 PM
Attachment _diff_extend_limits.txt [ 10108 ]
Detlef Riekenberg made changes - 13/Jun/10 05:39 PM
Comment [ Here is the second patch.
--
By by ... Detlef ]
Detlef Riekenberg made changes - 14/Jun/10 01:05 PM
Attachment _diff_extend_limits.txt [ 10108 ]
Detlef Riekenberg added a comment - 14/Jun/10 01:09 PM
Updated Patch:
Add also INT_MIN and LONG_MIN (needed by WIne)

--
By by ... Detlef

Detlef Riekenberg made changes - 14/Jun/10 01:09 PM
Attachment _diff_extend_limits.txt [ 10109 ]
Anders Magnusson made changes - 04/May/14 03:03 PM
Assignee Anders Magnusson [ ragge ]
Anders Magnusson added a comment - 04/May/14 03:04 PM
As far as I can see all these bugs are fixed now.

Anders Magnusson made changes - 04/May/14 03:04 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]