003 File Manager
Current Path:
/usr/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers
usr
/
src
/
cddl
/
contrib
/
opensolaris
/
cmd
/
dtrace
/
test
/
tst
/
common
/
pointers
/
📁
..
📄
err.BadAlign.d
(1.2 KB)
📄
err.D_ADDROF_VAR.ArrayVar.d
(1.2 KB)
📄
err.D_ADDROF_VAR.DynamicVar.d
(1.3 KB)
📄
err.D_ADDROF_VAR.agg.d
(1.23 KB)
📄
err.D_DEREF_NONPTR.noptr.d
(1.11 KB)
📄
err.D_DEREF_VOID.VoidPointerDeref.d
(1.23 KB)
📄
err.D_OP_ARRFUN.ArrayAssignment.d
(1.48 KB)
📄
err.D_OP_INCOMPAT.VoidPointerArith.d
(1.23 KB)
📄
err.D_OP_LVAL.AddressChange.d
(1.27 KB)
📄
err.D_OP_PTR.NonPointerAccess.d
(1.34 KB)
📄
err.D_OP_PTR.badpointer.d
(1.19 KB)
📄
err.D_OP_SOU.BadPointerAccess.d
(1.23 KB)
📄
err.D_OP_SOU.badpointer.d
(1.15 KB)
📄
err.InvalidAddress1.d
(1.29 KB)
📄
err.InvalidAddress2.d
(1.26 KB)
📄
err.InvalidAddress3.d
(1.21 KB)
📄
err.InvalidAddress4.d
(1.31 KB)
📄
err.InvalidAddress5.d
(1.72 KB)
📄
tst.ArrayPointer1.d
(5.14 KB)
📄
tst.ArrayPointer2.d
(1.71 KB)
📄
tst.ArrayPointer3.d
(1.67 KB)
📄
tst.GlobalVar.d
(1.46 KB)
📄
tst.IntegerArithmetic1.d
(1.57 KB)
📄
tst.PointerArithmetic1.d
(1.44 KB)
📄
tst.PointerArithmetic2.d
(1.71 KB)
📄
tst.PointerArithmetic3.d
(1.37 KB)
📄
tst.PointerAssignment.d
(1.66 KB)
📄
tst.ValidPointer1.d
(1.26 KB)
📄
tst.ValidPointer2.d
(1.26 KB)
📄
tst.VoidCast.d
(1.32 KB)
📄
tst.basic1.d
(1.27 KB)
📄
tst.basic2.d
(1.33 KB)
Editing: tst.ArrayPointer3.d
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: In D, the an array variable can be assigned to a pointer. * * SECTION: Pointers and Arrays/Pointer and Array Relationship * * NOTES: * */ #pragma D option quiet int array[5]; int *p; BEGIN { array[0] = 100; array[1] = 200; array[2] = 300; array[3] = 400; array[4] = 500; p = array; printf("array[0]: %d\tp[0]: %d\n", array[0], p[0]); printf("array[1]: %d\tp[1]: %d\n", array[1], p[1]); printf("array[2]: %d\tp[2]: %d\n", array[2], p[2]); printf("array[3]: %d\tp[3]: %d\n", array[3], p[3]); printf("array[4]: %d\tp[4]: %d\n", array[4], p[4]); exit(0); } END /(array[0] != p[0]) || (array[1] != p[1]) || (array[2] != p[2]) || (array[3] != p[3]) || (array[4] != p[4])/ { printf("Error"); exit(1); }
Upload File
Create Folder