Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: From: "Borkhuis, Johan" To: "'cygwin AT sourceware DOT cygnus DOT com'" Subject: Newlib 1.8.1 problem: strcat causes bus address error Date: Tue, 16 Nov 1999 13:31:35 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain Hello, We are using the GNU toolchain for m68k and newlib. When we are running our SW we get a bus address error. This error occurs in strcat. The code where the problem comes from is the following: /* Skip over the data in s1 as quickly as possible. */ if (ALIGNED (s1)) { unsigned long *aligned_s1 = (unsigned long *)s1; while (!DETECTNULL (*aligned_s1)) aligned_s1++; s1 = (char *)aligned_s1; } with ALLIGNED replaced with the following: #define ALIGNED(X) (((long)X & (sizeof (long) - 1))) The error occured in the first assignement, because s1 is not alligned. The problems is created by the macro ALLIGNED. When X is not a multiple of 4 (for a 32 bit long) this function returns TRUE when it should return FALSE. (BTW: this macro is also used in other modules, but there it is called UNALLIGNED.) Did anyone discover this problem, or is there a workaround for this? Groeten Johan -- o o o o o o o . . . ___________________________________ o _____ || Johan Borkhuis | .][__n_n_|DD[ ====_____ | johan DOT borkhuis AT peektraffic DOT nl | >(________|__|_[_________]_|________________________________| _/oo OOOOO oo` ooo ooo 'o!o!o o!o!o` = VxWorks page: http://www.xs4all.nl/~borkhuis/vxworks/vxworks.html = -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com