Hi Christoph (and markusstoll)

The reason this isn't compiling is because of a change made by markusstoll on 
18 April to Utilities/Adaptors/Adaptor/shmem.c .With his changes, shown below,  
WOShmem_base_address is type (void *) and on line 78 offset is cast to (void 
*). The compiler is rightfully complaining that you are adding a pointer 
address to a pointer address which you would never want to do. I changed line 
78 to remove the cast to (void *) of offset and it now compiles. I haven't 
tested it though so I am not sure of the ramifications of my change or other 
changes made by markusstoll. (In markusstoll's defence, the original code was 
probably also wrong, it was just the compiler couldn't pick up the error).

The following is the diff shown on github between before and after 
markusstoll's change.

69              
-static intptr_t WOShmem_base_address = -1;
         69     
+static void * WOShmem_base_address = -1;
70       70     
 
71       71     
 /*
72       72     
  * The total size of the mapped memory.
 @@ -75,8 +75,8 @@ static unsigned int WOShmem_size = 0;
75       75     
 
76       76     
 static WA_recursiveLock WOShmem_mutex;
77       77     
 
78              
-#define offset_to_addr(offset) ((void *)(WOShmem_base_address + 
(intptr_t)offset))
79              
-#define addr_to_offset(addr) ((intptr_t)addr - WOShmem_base_address)
         78     
+#define offset_to_addr(offset) ((void *)(WOShmem_base_address + (void 
*)offset))
         79     
+#define addr_to_offset(addr) ((void *)addr - WOShmem_base_address)



Regards

Tim


On 20 May 2014, at 19:41, CHRISTOPH WICK | i4innovation GmbH, Bonn 
<c...@i4innovation.de> wrote:

> Hi List,
> 
> I'm trying to build the Apache Adaptor for Ubuntu 14 LTS manually following 
> the instructions on 
> http://wiki.wocommunity.org/display/documentation/Compiling+the+HTTP+adaptor+on+Linux
> 
> If I try to execute "make CC=gcc", I get the following error:
> 
>> gcc -I/usr/local/include -O2 -I../Adaptor  -DSINGLE_THREADED_ADAPTOR -DLINUX 
>> -DCGI -c ../Adaptor/shmem.c
>> ../Adaptor/shmem.c:69:38: warning: initialization makes pointer from integer 
>> without a cast [enabled by default]
>> static void * WOShmem_base_address = -1;
>>                                      ^
>> ../Adaptor/shmem.c: In function '€˜WOShmem_alloc'€™:
>> ../Adaptor/shmem.c:78:63: error: invalid operands to binary + (have '€˜void 
>> *'€™ and '€˜void *'€™)
>> #define offset_to_addr(offset) ((void *)(WOShmem_base_address + (void 
>> *)offset))
>>                                                               ^
>> ../Adaptor/shmem.c:294:18: note: in expansion of macro '€˜offset_to_addr'€™
>>    r = (Region *)offset_to_addr(0);
>>                  ^
>> ../Adaptor/shmem.c:78:63: error: invalid operands to binary + (have '€˜void 
>> *'€™ and '€˜void *'€™)
>> #define offset_to_addr(offset) ((void *)(WOShmem_base_address + (void 
>> *)offset))
>>                                                               ^
>> ../Adaptor/shmem.c:305:19: note: in expansion of macro '€˜offset_to_addr'€™
>>             ret = offset_to_addr(r->offset);
>>                   ^
>> ../Adaptor/shmem.c:78:63: error: invalid operands to binary + (have '€˜void 
>> *'€™ and '€˜void *'€™)
>> #define offset_to_addr(offset) ((void *)(WOShmem_base_address + (void 
>> *)offset))
>>                                                               ^
>> ../Adaptor/shmem.c:330:41: note: in expansion of macro '€˜offset_to_addr'€™
>>                   newRegion = (Region *)offset_to_addr(r->nextRegion);
>>                                         ^
>> ../Adaptor/shmem.c:78:63: error: invalid operands to binary + (have '€˜void 
>> *'€™ and '€˜void *'€™)
>> #define offset_to_addr(offset) ((void *)(WOShmem_base_address + (void 
>> *)offset))
>>                                                               ^
>> ../Adaptor/shmem.c:336:25: note: in expansion of macro '€˜offset_to_addr'€™
>>                   ret = offset_to_addr(newRegion->offset);
>>                         ^
>> ../Adaptor/shmem.c:78:63: error: invalid operands to binary + (have '€˜void 
>> *'€™ and '€˜void *'€™)
>> #define offset_to_addr(offset) ((void *)(WOShmem_base_address + (void 
>> *)offset))
>>                                                               ^
>> ../Adaptor/shmem.c:345:24: note: in expansion of macro '€˜offset_to_addr'€™
>>          r = (Region *)offset_to_addr(r->nextRegion);
>>                        ^
>> make[1]: *** [shmem.o] Error 1
>> make[1]: Leaving directory 
>> `/tmp/wocommunity-wonder-a5ffd1f/Utilities/Adaptors/CGI'
>> make: *** [CGI] Error 2
>> 
> 
> Any ideas how to get this running?
> 
> Thx,
> C.U.CW
> -- 
> The three great virtues of a programmer are Laziness, Impatience and Hubris. 
> (Randal Schwartz)
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/tim%40triptera.com.au
> 
> This email sent to t...@triptera.com.au

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to