<< Back to previous view

[PCC-226] d = v++; done wrong; macro expansion has Ctrl-D and Ctrl-E characters Created: 29/Jan/11  Updated: 30/Jan/11

Status: Closed
Project: pcc
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Fred J. Tydeman Assignee: Anders Magnusson
Resolution: Fixed Votes: 0
Environment: Intel Pentium 4m in 32-bit mode; Linux Fedora Core 14; pcc 0.9.9 of 2010/11/19

 * 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)\
   ckFailed = 0;\
   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) \
  ck(1 == v);\
  d= v++;\
  ck(2 == v);\
  ck(1. == d)

  tst_uni( ld_aut );

  return 0;

Comment by Anders Magnusson [ 30/Jan/11 11:09 AM ]
Both of these issues has been fixed last months.
Generated at Sat Oct 21 08:38:22 CEST 2017 using JIRA Enterprise Edition, Version: 3.13.1-#333.