Issue Details (XML | Word | Printable)

Key: PCC-226
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Fred J. Tydeman
Votes: 0
Watchers: 0
Operations

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

d = v++; done wrong; macro expansion has Ctrl-D and Ctrl-E characters

Created: 29/Jan/11 11:27 PM   Updated: 30/Jan/11 11:09 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Environment: Intel Pentium 4m in 32-bit mode; Linux Fedora Core 14; pcc 0.9.9 of 2010/11/19


 Description  « Hide
/*
 * Two problems:
 * ld_aut is not 2
 * ld_aut in error message has Ctrl-D before it and Ctrl-E after it.
 */
#include <stdio.h> /* puts(), printf() */

static unsigned long int NumFail = 0uL;
static unsigned long int NumPass = 0uL;
static int ckFailed = 0;

    #define ck(a)\
 if(a){\
   NumPass++;\
   ckFailed = 0;\
 }else{\
   NumFail++;\
   ckFailed = 1;\
   (void)printf("\nError in line %d in %s\n", __LINE__, __FILE__ );\
   (void)puts( #a );\
 }

int main(void){
  long double ld_aut;
  double d;

  #define tst_uni(v) \
  v=0;\
  v++;\
  ck(1 == v);\
  d= v++;\
  ck(2 == v);\
  ck(1. == d)

  tst_uni( ld_aut );

  return 0;
}


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 30/Jan/11 11:09 AM
Both of these issues has been fixed last months.