Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP-IDF V5.2.3 Bug or Miss Interpret in Compiler at Printf level (IDFGH-13927) #14766

Closed
3 tasks done
filzek opened this issue Oct 22, 2024 · 1 comment
Closed
3 tasks done
Assignees
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally

Comments

@filzek
Copy link

filzek commented Oct 22, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

There is an error inside the Printf compiler optmizations and also with the stub.

unsigned long sensor_received = 12345647;
unsigned long last_sensorid_received = 12345649;
unsigned long sensor_length = 0;
struct timeval tv2;
gettimeofday( & tv2, NULL);
printf("Time: %ld seconds\n", tv2.tv_sec); // Separate print for tv.tv_sec

	printf("Before first printf: sensor_received = [%lu]\n", sensor_received);
	printf("RECEIVED [%lu]\n", sensor_received);
	printf("Before second printf: sensor_received = [%lu]\n", sensor_received);

	printf("[%d] [%ld] RX433 Received: SENSOR [%lu] - last_sensorid_received [%lu]\n",
   __LINE__, tv2.tv_sec, sensor_received, last_sensorid_received);

	printf("[%d] RX433 Received: SENSOR [%lu] - last_sensorid_received [%lu]\n",
				 __LINE__, sensor_received, last_sensorid_received);

	printf("RX433 Received: SENSOR [%lu] - last_sensorid_received [%lu]\n",
				 sensor_received, last_sensorid_received);

to validate all kind of possible acttions the code try all kinds.

Before first printf: sensor_received = [12345647]
RECEIVED [12345647]
Before second printf: sensor_received = [12345647]
[1526] [0] RX433 Received: SENSOR [0] - last_sensorid_received [12345647]
[1529] RX433 Received: SENSOR [12345647] - last_sensorid_received [12345649]
RX433 Received: SENSOR [12345647] - last_sensorid_received [12345649]

1526] [0] RX433 Received: SENSOR [0] - last_sensorid_received [12345647]

this could be related to the %ld type not being correct alligned with the compiler in this arguments?

as of using
printf("[%d] [%" PRId64 "] RX433 Received: SENSOR [%lu] - last_sensorid_received [%lu]\n",
LINE, tv2.tv_sec, sensor_received, last_sensorid_received);

this prints correct, so, why in the esp-idf the type is PRId64 ?

@espressif-bot espressif-bot added the Status: Opened Issue is new label Oct 22, 2024
@github-actions github-actions bot changed the title ESP-IDF V5.2.3 Bug in Compiler at Printf level ESP-IDF V5.2.3 Bug in Compiler at Printf level (IDFGH-13927) Oct 22, 2024
@filzek filzek changed the title ESP-IDF V5.2.3 Bug in Compiler at Printf level (IDFGH-13927) ESP-IDF V5.2.3 Bug or Miss Interpret in Compiler at Printf level (IDFGH-13927) Oct 22, 2024
@Lapshin
Copy link
Collaborator

Lapshin commented Oct 23, 2024

@filzek , please refer to espressif/crosstool-NG#62 (comment)

@filzek filzek closed this as completed Nov 8, 2024
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Won't Do This will not be worked on and removed Status: Opened Issue is new labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Won't Do This will not be worked on Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants