[nycbug-talk] invalid type argument of '->'

Michael Hernandez mhernandez at techally.com
Wed Mar 26 10:50:59 EDT 2008


On Mar 21, 2008, at 1:07 PM, Tim A. wrote:

> Tim A. wrote:
>>
>> Michael Hernandez wrote:
>>>
>>> On Mar 18, 2008, at 3:36 PM, Marc Spitzer wrote:
>>>
>>>
>>>> On Tue, Mar 18, 2008 at 2:46 PM, Michael Hernandez
>>>> <mhernandez at techally.com> wrote:
>>>>
>>>>> I am trying to build the php5-spl port and I keep getting errors  
>>>>> like
>>>>> this:
>>>>>
>>>>> /usr/ports/devel/php5-spl/work/php-5.2.5/ext/spl/php_spl.c:61:  
>>>>> error:
>>>>> invalid type argument of `->'
>>>>>
>>>>> I looked at php_spl.c - I don't see what's wrong with it. The line
>>>>> is:
>>>>>
>>>>> spl_globals->autoload_extensions     = NULL;
>>>>>
>>>>>
>>>>> Is that not valid code? Is my gcc just old? I'm running out of  
>>>>> ideas
>>>>> here. Any help would be appreciated.
>>>>>
>>>> is spl_globals a pointer?  Stupid question but it is complaining  
>>>> that
>>>> it can not do a pointer dereference and access structure field.
>>>>
>>>> marc
>>>>
>>>>
>>> To be quite honest, I'm not sure - I guess the PHP hackers might be
>>> too used to hacking in PHP and so their C is getting sloppy? Which
>>> isn't good since PHP is written in C, not PHP. :)
>>>
>>>
>>
>> I just gave it a go. Installed from port just fine on 6.2.
>> Stupid question, but have you tried a portsnap?
>>
>
> I've been brushing up on my C lately. (btw, O'Reilly's C Pocket  
> Reference is really good.)
> So, Mark's pointer question got me curious and I thought I'd look it  
> up.
> It seems easy enough to determine.
> Assuming we're in /usr/ports/devel/php5-spl
> After you've at least attempted to install the port once, you should  
> have a directory called work.
> # find work -type f -exec grep -Hn spl_globals {} \;
>
> Which indicates as I might have suspected, the answer is in php_spl.h
>
> I think the following lines indicate that spl_globals is a pointer  
> variable of type zend_spl_globals which would appear to be a pointer  
> to a structure but I can't find where zend_spl_globals is  
> implemented. It seems to not be in these source files.
>
> #ifdef ZTS
> # define SPL_G(v) TSRMG(spl_globals_id, zend_spl_globals *, v)
> extern int spl_globals_id;
> #else
> # define SPL_G(v) (spl_globals.v)
> extern zend_spl_globals spl_globals;
> #endif
>
>
> I don't understand preprocessing though. So, I'm not sure exactly  
> what the # define lines mean or how they work. (Coming up to that  
> part).
> Only thing I ever used those for were including standard headers.
>
>
>
>

I actually couldn't find the lines causing the errors at first due to  
vim line folding that was enabled by default somehow.

Also, yes I did portsnap before attemping my 3rd time.

Sorry for the late reply I just got 20+ messages from nycbug in one  
shot, apparently my favorite exchange server here at the office is up  
to it's old tricks again....

--Mike H
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nycbug.org/pipermail/talk/attachments/20080326/2c9f5fa8/attachment.html>


More information about the talk mailing list